From b78979d6920639b72d514f87cc43bd354f107937 Mon Sep 17 00:00:00 2001 From: Julien Levesy Date: Fri, 30 Dec 2016 17:17:21 +0100 Subject: replace match by if let statements if possible --- components/script/dom/treewalker.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'components/script/dom/treewalker.rs') 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 } }, _ => {} -- cgit v1.2.3