diff --git a/01.workspace/heave/src/imp/catalog_delete.rs b/01.workspace/heave/src/imp/catalog_delete.rs index 539a947..31e1264 100644 --- a/01.workspace/heave/src/imp/catalog_delete.rs +++ b/01.workspace/heave/src/imp/catalog_delete.rs @@ -16,7 +16,7 @@ impl Catalog { /// # Arguments /// /// * `id` - The ID of the entity to mark for deletion. - pub fn delete(&mut self, id: &str) { + pub fn delete(&self, id: &str) { let _ = self.on_items(|items| { let entity = items.get_mut(id); if let Some(entity) = entity { diff --git a/01.workspace/heave/src/tst/catalog_delete.rs b/01.workspace/heave/src/tst/catalog_delete.rs index 5376998..7afb7b1 100644 --- a/01.workspace/heave/src/tst/catalog_delete.rs +++ b/01.workspace/heave/src/tst/catalog_delete.rs @@ -4,7 +4,7 @@ mod tests { #[test] fn delete_should_mark_entity_as_to_delete() { // Should mark an existing entity's state as 'ToDelete'. - let mut catalog = Catalog::new("dummy.db"); + let catalog = Catalog::new("dummy.db"); let item = Item { id: "item-123".to_string(), name: "Test Item".to_string(), @@ -27,7 +27,7 @@ mod tests { #[test] fn delete_should_have_no_effect_for_nonexistent_id() { // Should have no effect if the entity ID does not exist. - let mut catalog = Catalog::new("dummy.db"); + let catalog = Catalog::new("dummy.db"); let item = Item { id: "item-123".to_string(), name: "Test Item".to_string(), diff --git a/01.workspace/heave/src/tst/catalog_persist.rs b/01.workspace/heave/src/tst/catalog_persist.rs index faf5708..fb3be35 100644 --- a/01.workspace/heave/src/tst/catalog_persist.rs +++ b/01.workspace/heave/src/tst/catalog_persist.rs @@ -43,7 +43,7 @@ mod tests { std::fs::remove_file(path).unwrap(); } // 1. Create catalog, insert an item, and persist it. - let mut catalog1 = Catalog::new(db_path); + let catalog1 = Catalog::new(db_path); catalog1.init().unwrap(); let item1 = Item { id: "item-to-delete".to_string(), @@ -248,7 +248,7 @@ mod tests { std::fs::remove_file(path).unwrap(); } // 1. Setup: Create a catalog and pre-populate it with some data. - let mut catalog = Catalog::new(db_path); + let catalog = Catalog::new(db_path); catalog.init().unwrap(); let item_to_update = Item { id: "update-me".to_string(),