From f5f4d666d5accb2407d3672345f777055b433013 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sun, 19 Mar 2023 20:48:39 -0700 Subject: [PATCH] Address lint. --- procmail2notmuch/src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/procmail2notmuch/src/main.rs b/procmail2notmuch/src/main.rs index f818cbc..6a8c70b 100644 --- a/procmail2notmuch/src/main.rs +++ b/procmail2notmuch/src/main.rs @@ -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(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 => "",