aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/treewalker.rs
diff options
context:
space:
mode:
authorJulien Levesy <jlevesy@gmail.com>2016-12-30 17:17:21 +0100
committerJulien Levesy <jlevesy@gmail.com>2016-12-31 12:34:05 +0100
commitb78979d6920639b72d514f87cc43bd354f107937 (patch)
tree6a50fa990864d957ed35b3fa805939de6e8b0c03 /components/script/dom/treewalker.rs
parent608511ddc3440bfa92b8cb001b5e9f10bc291150 (diff)
downloadservo-b78979d6920639b72d514f87cc43bd354f107937.tar.gz
servo-b78979d6920639b72d514f87cc43bd354f107937.zip
replace match by if let statements if possible
Diffstat (limited to 'components/script/dom/treewalker.rs')
-rw-r--r--components/script/dom/treewalker.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/components/script/dom/treewalker.rs b/components/script/dom/treewalker.rs
index 2a3367b3393..6dba79e893b 100644
--- a/components/script/dom/treewalker.rs
+++ b/components/script/dom/treewalker.rs
@@ -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
}
},
_ => {}