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:
parent
ac914b27e2
commit
ce678d6418
1 changed files with 7 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue