From 5a421d7c5f91913cc5c5f386062c6982fd951b18 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Wed, 2 Aug 2017 15:42:57 -0700 Subject: [PATCH] Use drain() over IntoIter on a few SmallVecs. This is all the ones I could find in style/ and selectors/. --- components/selectors/parser.rs | 2 +- components/style/stylist.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs index e9b59f7f831..06f381d600c 100644 --- a/components/selectors/parser.rs +++ b/components/selectors/parser.rs @@ -1528,7 +1528,7 @@ fn parse_compound_selector<'i, 't, P, E, Impl>( } builder.push_simple_selector(Component::PseudoElement(p)); - for state_selector in state_selectors.into_iter() { + for state_selector in state_selectors.drain() { builder.push_simple_selector(state_selector); } diff --git a/components/style/stylist.rs b/components/style/stylist.rs index e70a0e2fc01..4e200076967 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -939,7 +939,7 @@ impl Stylist { if !declarations.is_empty() { let rule_node = self.rule_tree.insert_ordered_rules_with_important( - declarations.into_iter().map(|a| a.order_and_level()), + declarations.drain().map(|a| a.order_and_level()), guards); if rule_node != *self.rule_tree.root() { inputs.visited_rules = Some(rule_node);