replace match by if let statements if possible

This commit is contained in:
Julien Levesy 2016-12-30 17:17:21 +01:00
parent 608511ddc3
commit b78979d692
7 changed files with 39 additions and 58 deletions

View file

@ -286,13 +286,10 @@ impl TreeWalker {
NodeFilterConstants::FILTER_SKIP => {
// "1. Let child be node's first child if type is first,
// and node's last child if type is last."
match next_child(&node) {
if let Some(child) = next_child(&node) {
// "2. If child is not null, set node to child and goto Main."
Some(child) => {
node = child;
continue 'main
},
None => {}
node = child;
continue 'main
}
},
_ => {}