diff --git a/rslib/src/backend/mod.rs b/rslib/src/backend/mod.rs index 511a9830b..fa399529a 100644 --- a/rslib/src/backend/mod.rs +++ b/rslib/src/backend/mod.rs @@ -663,7 +663,7 @@ impl BackendService for Backend { } fn remove_decks(&self, input: pb::DeckIDs) -> BackendResult { - self.with_col(|col| col.remove_decks_and_child_decks(input.into())) + self.with_col(|col| col.remove_decks_and_child_decks(&Into::>::into(input))) .map(Into::into) } diff --git a/rslib/src/decks/mod.rs b/rslib/src/decks/mod.rs index 0aeccf8a0..763aaf7db 100644 --- a/rslib/src/decks/mod.rs +++ b/rslib/src/decks/mod.rs @@ -440,14 +440,14 @@ impl Collection { self.storage.get_deck_id(&machine_name) } - pub fn remove_decks_and_child_decks(&mut self, dids: Vec) -> Result<()> { + pub fn remove_decks_and_child_decks(&mut self, dids: &[DeckID]) -> Result<()> { // fixme: vet cache clearing self.state.deck_cache.clear(); self.transact(None, |col| { let usn = col.usn()?; for did in dids { - if let Some(deck) = col.storage.get_deck(did)? { + if let Some(deck) = col.storage.get_deck(*did)? { let child_decks = col.storage.child_decks(&deck)?; // top level @@ -779,7 +779,7 @@ mod test { // delete top level let top = col.get_or_create_normal_deck("one")?; - col.remove_decks_and_child_decks(vec![top.id])?; + col.remove_decks_and_child_decks(&[top.id])?; // should have come back as "Default+" due to conflict assert_eq!(sorted_names(&col), vec!["default", "Default+"]); diff --git a/rslib/src/sync/mod.rs b/rslib/src/sync/mod.rs index 8c899c4e6..dbfa87d0c 100644 --- a/rslib/src/sync/mod.rs +++ b/rslib/src/sync/mod.rs @@ -1532,7 +1532,7 @@ mod test { col1.remove_cards_and_orphaned_notes(&[cardid])?; let usn = col1.usn()?; col1.remove_note_only_undoable(noteid, usn)?; - col1.remove_decks_and_child_decks(vec![deckid])?; + col1.remove_decks_and_child_decks(&[deckid])?; let out = ctx.normal_sync(&mut col1).await; assert_eq!(out.required, SyncActionRequired::NoChanges);