[librsvg: 7/9] Replace iterator search followed by is_some() with any()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 7/9] Replace iterator search followed by is_some() with any()
- Date: Sat, 1 Feb 2020 19:08:09 +0000 (UTC)
commit 409d70b009e3fc37d3c22f92e12ce97ff7c747e9
Author: Sven Neumann <sven svenfoo org>
Date: Thu Jan 30 09:13:31 2020 +0100
Replace iterator search followed by is_some() with any()
https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
rsvg_internals/src/drawing_ctx.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 88b4339d..f04c0adc 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -1407,7 +1407,7 @@ impl<'i> AcquiredNodes<'i> {
Ok(node)
} else {
let node_type = node.borrow().get_type();
- if node_types.iter().find(|&&t| t == node_type).is_some() {
+ if node_types.iter().any(|&t| t == node_type) {
Ok(node)
} else {
Err(AcquireError::InvalidLinkType(fragment.clone()))
@@ -1488,6 +1488,6 @@ impl NodeStack {
}
pub fn contains(&self, node: &RsvgNode) -> bool {
- self.0.iter().find(|n| **n == *node).is_some()
+ self.0.iter().any(|n| *n == *node)
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]