diff --git a/rslib/src/scheduler/bury_and_suspend.rs b/rslib/src/scheduler/bury_and_suspend.rs index 8d124504d..3bfc055bf 100644 --- a/rslib/src/scheduler/bury_and_suspend.rs +++ b/rslib/src/scheduler/bury_and_suspend.rs @@ -159,8 +159,10 @@ mod test { #[test] fn unbury() { let mut col = open_test_collection(); - let mut card = Card::default(); - card.queue = CardQueue::UserBuried; + let mut card = Card { + queue: CardQueue::UserBuried, + ..Default::default() + }; col.add_card(&mut card).unwrap(); let assert_count = |col: &mut Collection, cnt| { assert_eq!( diff --git a/rslib/src/scheduler/queue/builder/gathering.rs b/rslib/src/scheduler/queue/builder/gathering.rs index fdafa8b36..06838f479 100644 --- a/rslib/src/scheduler/queue/builder/gathering.rs +++ b/rslib/src/scheduler/queue/builder/gathering.rs @@ -116,8 +116,10 @@ mod test { #[test] fn new_siblings() { - let mut builder = QueueBuilder::default(); - builder.bury_new = true; + let mut builder = QueueBuilder { + bury_new: true, + ..Default::default() + }; let mut limits = RemainingLimits { review: 0, new: 100, diff --git a/rslib/src/sync/mod.rs b/rslib/src/sync/mod.rs index 6d2c6c1da..09fb768fc 100644 --- a/rslib/src/sync/mod.rs +++ b/rslib/src/sync/mod.rs @@ -1379,8 +1379,10 @@ mod test { let mut deck = col1.get_or_create_normal_deck("new deck")?; // give it a new option group - let mut dconf = DeckConf::default(); - dconf.name = "new dconf".into(); + let mut dconf = DeckConf { + name: "new dconf".into(), + ..Default::default() + }; col1.add_or_update_deck_config(&mut dconf, false)?; if let DeckKind::Normal(deck) = &mut deck.kind { deck.config_id = dconf.id.0; diff --git a/rslib/src/tags.rs b/rslib/src/tags.rs index e46bd22eb..18c2cea80 100644 --- a/rslib/src/tags.rs +++ b/rslib/src/tags.rs @@ -661,8 +661,8 @@ mod test { // differing case should result in only one parent case being added - // the first one col.storage.clear_all_tags()?; - *(&mut note.tags[0]) = "foo::BAR::a".into(); - *(&mut note.tags[1]) = "FOO::bar::b".into(); + note.tags[0] = "foo::BAR::a".into(); + note.tags[1] = "FOO::bar::b".into(); col.update_note(&mut note)?; assert_eq!( col.tag_tree()?, @@ -679,8 +679,8 @@ mod test { // things should work even if the immediate parent is not missing col.storage.clear_all_tags()?; - *(&mut note.tags[0]) = "foo::bar::baz".into(); - *(&mut note.tags[1]) = "foo::bar::baz::quux".into(); + note.tags[0] = "foo::bar::baz".into(); + note.tags[1] = "foo::bar::baz::quux".into(); col.update_note(&mut note)?; assert_eq!( col.tag_tree()?, @@ -698,8 +698,8 @@ mod test { // numbers have a smaller ascii number than ':', so a naive sort on // '::' would result in one::two being nested under one1. col.storage.clear_all_tags()?; - *(&mut note.tags[0]) = "one".into(); - *(&mut note.tags[1]) = "one1".into(); + note.tags[0] = "one".into(); + note.tags[1] = "one1".into(); note.tags.push("one::two".into()); col.update_note(&mut note)?; assert_eq!( @@ -713,9 +713,9 @@ mod test { // children should match the case of their parents col.storage.clear_all_tags()?; - *(&mut note.tags[0]) = "FOO".into(); - *(&mut note.tags[1]) = "foo::BAR".into(); - *(&mut note.tags[2]) = "foo::bar::baz".into(); + note.tags[0] = "FOO".into(); + note.tags[1] = "foo::BAR".into(); + note.tags[2] = "foo::bar::baz".into(); col.update_note(&mut note)?; assert_eq!(note.tags, vec!["FOO", "FOO::BAR", "FOO::BAR::baz"]);