summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-10-07 17:44:58 +0200
committerMatthias Beyer <mail@beyermatthias.de>2018-10-07 17:46:21 +0200
commit1c36bd61a8f30b147500c47f2e593ae89431c042 (patch)
treedcf447920eff5953d09158833aaa92b8727bc147
parenta281dc1e950ef118c927d91f8bdc1226ff884dbc (diff)
Fix: Check whether header value contains msgidHEADmaster
This is better because of the "References:" header field. The field may contain several entries. As the `mailparse` library does not return a `Vec<>` of values here, we simlpy use the `String::contains()` function to check whether the mails could be related. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs12
2 files changed, 7 insertions, 7 deletions
diff --git a/Cargo.toml b/Cargo.toml
index e76643f..2fc8496 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "amt"
-version = "0.1.0"
+version = "0.1.1"
authors = ["Matthias Beyer <mail@beyermatthias.de>"]
description = "Accumulate git-trailers from emails grouped by mail subject"
keywords = ["tool", "git", "cli", "mail", "email"]
diff --git a/src/main.rs b/src/main.rs
index 717c715..bf60e85 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -115,12 +115,12 @@ fn main() {
|| key == "Message-Id"
|| key == "References"
{
- let value = hdr.get_value().unwrap_or_else(|e| {
- eprintln!("Failed to get mail header value: {} - {:?}", path.display(), e);
- exit(1)
- });
-
- value == msgid
+ hdr.get_value()
+ .unwrap_or_else(|e| {
+ eprintln!("Failed to get mail header value: {} - {:?}", path.display(), e);
+ exit(1)
+ })
+ .contains(msgid)
} else {
false
}