Use drain() over IntoIter on a few SmallVecs.

This is all the ones I could find in style/ and selectors/.
This commit is contained in:
Bobby Holley 2017-08-02 15:42:57 -07:00
parent e07beacd4d
commit 5a421d7c5f
2 changed files with 2 additions and 2 deletions

View file

@ -1528,7 +1528,7 @@ fn parse_compound_selector<'i, 't, P, E, Impl>(
} }
builder.push_simple_selector(Component::PseudoElement(p)); 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); builder.push_simple_selector(state_selector);
} }

View file

@ -939,7 +939,7 @@ impl Stylist {
if !declarations.is_empty() { if !declarations.is_empty() {
let rule_node = let rule_node =
self.rule_tree.insert_ordered_rules_with_important( 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); guards);
if rule_node != *self.rule_tree.root() { if rule_node != *self.rule_tree.root() {
inputs.visited_rules = Some(rule_node); inputs.visited_rules = Some(rule_node);