Resolve TODO: Do not hide error, but instantly return it
This commit is contained in:
parent
7a5134ead2
commit
e9519e9a3d
1 changed files with 9 additions and 6 deletions
|
@ -50,12 +50,15 @@ impl Hasher for MailHasher {
|
||||||
|
|
||||||
let filter = subject_filter.or(from_filter).or(to_filter);
|
let filter = subject_filter.or(from_filter).or(to_filter);
|
||||||
|
|
||||||
let s : String = mail.headers
|
let mut v = vec![];
|
||||||
.iter()
|
for hdr in mail.headers.iter().filter(|item| filter.filter(item)) {
|
||||||
.filter(|item| filter.filter(item))
|
let s = try!(hdr.get_value()
|
||||||
.filter_map(|hdr| hdr.get_value().ok()) // TODO: Do not hide error here
|
.map_err(Box::new)
|
||||||
.collect::<Vec<String>>()
|
.map_err(|e| REK::RefHashingError.into_error_with_cause(e)));
|
||||||
.join("");
|
|
||||||
|
v.push(s);
|
||||||
|
}
|
||||||
|
let s : String = v.join("");
|
||||||
|
|
||||||
self.defaulthasher.create_hash(pb, &mut s.as_bytes())
|
self.defaulthasher.create_hash(pb, &mut s.as_bytes())
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue