mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Replace some Option matching with higher order methods
This shrinks the code and should be easier to read if we are used to the idioms. Also change one copy to clone() while we're here.
This commit is contained in:
parent
bb51a9d6fb
commit
c047a4b436
8 changed files with 24 additions and 55 deletions
|
@ -415,10 +415,7 @@ impl<'self, View> AbstractNode<View> {
|
|||
impl<View> Iterator<AbstractNode<View>> for AbstractNodeChildrenIterator<View> {
|
||||
pub fn next(&mut self) -> Option<AbstractNode<View>> {
|
||||
let node = self.current_node;
|
||||
self.current_node = match self.current_node {
|
||||
None => None,
|
||||
Some(node) => node.next_sibling(),
|
||||
};
|
||||
self.current_node = self.current_node.chain(|node| node.next_sibling());
|
||||
node
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue