summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-02-24 22:33:41 +0100
committerMatthias Beyer <mail@beyermatthias.de>2019-02-24 22:33:41 +0100
commitce678d641801ce061c2b45035583464c389642f3 (patch)
tree093e47b0faf40fc4e2a8dc66d6765e3b5892ebb3
parentac914b27e24f6fbe9e1737bc0348197fec5688d9 (diff)
downloadimag-ce678d641801ce061c2b45035583464c389642f3.zip
imag-ce678d641801ce061c2b45035583464c389642f3.tar.gz
Fix: Compare different variables
The bug was that we compared the variable with itself, but one time to lowercase and one time not, so it was always false. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--lib/domain/libimagmail/src/util.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/domain/libimagmail/src/util.rs b/lib/domain/libimagmail/src/util.rs
index c58cf49..b1c2b5b 100644
--- a/lib/domain/libimagmail/src/util.rs
+++ b/lib/domain/libimagmail/src/util.rs
@@ -41,10 +41,13 @@ pub(crate) fn get_message_header_at_key<P: AsRef<Path>, K: AsRef<str>>(p: P, k:
.into_iter()
.filter_map(|hdr| match hdr.get_key() {
Err(e) => Some(Err(e).map_err(Error::from)),
- Ok(k) => if k.to_lowercase() == k.as_ref() {
- Some(Ok(hdr))
- } else {
- None
+ Ok(key) => {
+ trace!("Test: {} == {}", key.to_lowercase(), k.as_ref());
+ if key.to_lowercase() == k.as_ref() {
+ Some(Ok(hdr))
+ } else {
+ None
+ }
}
})
.next()