Skip to content

Commit

Permalink
Fix some clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Lauzier authored Jun 27, 2021
1 parent a2b52e5 commit 8a838f7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions usvg/src/svgtree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ impl<'a> Node<'a> {
}

pub fn parent_element(&self) -> Option<Self> {
self.ancestors().skip(1).filter(|n| n.is_element()).next()
self.ancestors().skip(1).find(|n| n.is_element())
}

pub fn prev_sibling(&self) -> Option<Self> {
Expand All @@ -363,7 +363,7 @@ impl<'a> Node<'a> {
}

pub fn first_element_child(&self) -> Option<Self> {
self.children().filter(|n| n.is_element()).next()
self.children().find(|n| n.is_element())
}

pub fn last_child(&self) -> Option<Self> {
Expand Down Expand Up @@ -458,11 +458,10 @@ impl<'a> Iterator for Children<'a> {
let node = self.front.take();
if self.front == self.back {
self.back = None;
node
} else {
self.front = node.as_ref().and_then(Node::next_sibling);
node
}
node
}
}

Expand All @@ -471,11 +470,10 @@ impl<'a> DoubleEndedIterator for Children<'a> {
let node = self.back.take();
if self.back == self.front {
self.front = None;
node
} else {
self.back = node.as_ref().and_then(Node::prev_sibling);
node
}
node
}
}

Expand Down

0 comments on commit 8a838f7

Please sign in to comment.