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>
This commit is contained in:
Matthias Beyer 2019-02-24 22:33:41 +01:00
parent ac914b27e2
commit ce678d6418

View file

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