Simplify implementation of has_tags()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
08ba6c68a6
commit
51dad94cc9
1 changed files with 1 additions and 6 deletions
|
@ -111,12 +111,7 @@ impl Tagable for Value {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn has_tags(&self, tags: &[Tag]) -> Result<bool> {
|
fn has_tags(&self, tags: &[Tag]) -> Result<bool> {
|
||||||
let mut result = true;
|
tags.iter().map(|t| self.has_tag(t)).fold(Ok(true), |a, e| a.and_then(|b| Ok(b && e?)))
|
||||||
for tag in tags {
|
|
||||||
result = result && self.has_tag(tag)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(result)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue