fix some clippy lints

This commit is contained in:
Damien Elmes 2021-03-06 14:30:29 +10:00
parent f1a1b0891e
commit 7900cc6868
4 changed files with 21 additions and 15 deletions

View File

@ -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!(

View File

@ -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,

View File

@ -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;

View File

@ -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"]);