Address lint.

This commit is contained in:
Bill Thiede 2023-03-19 20:48:39 -07:00
parent 7bfef154d9
commit f5f4d666d5

View File

@ -5,6 +5,7 @@ enum MatchType {
From,
Sender,
To,
Cc,
Subject,
List,
DeliveredTo,
@ -81,6 +82,11 @@ impl FromStr for Match {
match_type: MatchType::From,
needle: cleanup_match(FROM, needle),
});
} else if needle.starts_with(CC) {
return Ok(Match {
match_type: MatchType::Cc,
needle: cleanup_match(CC, needle),
});
} else if needle.starts_with(TOCC) {
return Ok(Match {
match_type: MatchType::To,
@ -88,7 +94,7 @@ impl FromStr for Match {
});
} else if needle.starts_with(SENDER) {
return Ok(Match {
match_type: MatchType::From,
match_type: MatchType::Sender,
needle: cleanup_match(SENDER, needle),
});
} else if needle.starts_with(SUBJECT) {
@ -140,7 +146,6 @@ impl FromStr for Match {
needle: cleanup_match("", &needle),
});
}
Ok(Match::default())
}
}
@ -161,6 +166,7 @@ fn notmuch_from_rules<W: Write>(mut w: W, rules: &[Rule]) -> anyhow::Result<()>
// TODO(wathiede): something more specific?
MatchType::Sender => "from:",
MatchType::To => "to:",
MatchType::Cc => "to:",
MatchType::Subject => "subject:",
MatchType::List => "List-ID:",
MatchType::Body => "",