Replace unwrap() with try!()

This commit is contained in:
Matthias Beyer 2016-08-04 14:06:02 +02:00
parent a07047b61a
commit 9982b3251c

View file

@ -120,13 +120,7 @@ impl Tagable for EntryHeader {
fn has_tags(&self, tags: &[Tag]) -> Result<bool> { fn has_tags(&self, tags: &[Tag]) -> Result<bool> {
let mut result = true; let mut result = true;
for tag in tags { for tag in tags {
let check = self.has_tag(tag); result = result && try!(self.has_tag(tag));
if check.is_err() {
return Err(check.unwrap_err());
}
let check = check.unwrap();
result = result && check;
} }
Ok(result) Ok(result)