From ad61cae6b069461edcde1e240aee6608ded46aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 15 Dec 2019 21:22:24 +0100 Subject: [PATCH] style: Update smallvec to 1.0. Differential Revision: https://phabricator.services.mozilla.com/D56044 --- components/fallible/Cargo.toml | 2 +- components/malloc_size_of/Cargo.toml | 2 +- components/selectors/Cargo.toml | 2 +- components/selectors/builder.rs | 4 ++-- components/style/Cargo.toml | 2 +- components/style/bloom.rs | 6 +++--- components/style/invalidation/element/invalidator.rs | 2 +- components/style/parallel.rs | 4 ++-- components/style/properties/declaration_block.rs | 2 +- components/style/rule_tree/mod.rs | 12 ++++++------ components/style/stylist.rs | 2 +- components/to_shmem/Cargo.toml | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/components/fallible/Cargo.toml b/components/fallible/Cargo.toml index e8f5314693b..49064da33ea 100644 --- a/components/fallible/Cargo.toml +++ b/components/fallible/Cargo.toml @@ -10,7 +10,7 @@ name = "fallible" path = "lib.rs" [dependencies] -smallvec = "0.6" +smallvec = "1.0" hashglobe = { path = "../hashglobe" } # This crate effectively does nothing except if the `known_system_malloc` diff --git a/components/malloc_size_of/Cargo.toml b/components/malloc_size_of/Cargo.toml index 2e112805067..eebe330c8c9 100644 --- a/components/malloc_size_of/Cargo.toml +++ b/components/malloc_size_of/Cargo.toml @@ -39,7 +39,7 @@ serde = { version = "1.0.27", optional = true } serde_bytes = { version = "0.11", optional = true } servo_arc = { path = "../servo_arc" } smallbitvec = "2.3.0" -smallvec = "0.6" +smallvec = "1.0" string_cache = { version = "0.8", optional = true } thin-slice = "0.1.0" time = { version = "0.1.17", optional = true } diff --git a/components/selectors/Cargo.toml b/components/selectors/Cargo.toml index 3b17207175b..8bf0ba716cb 100644 --- a/components/selectors/Cargo.toml +++ b/components/selectors/Cargo.toml @@ -29,7 +29,7 @@ fxhash = "0.2" phf = "0.8" precomputed-hash = "0.1" servo_arc = { version = "0.1", path = "../servo_arc" } -smallvec = "0.6" +smallvec = "1.0" thin-slice = "0.1.0" to_shmem = { path = "../to_shmem" } to_shmem_derive = { path = "../to_shmem_derive" } diff --git a/components/selectors/builder.rs b/components/selectors/builder.rs index 352557735b3..57551771174 100644 --- a/components/selectors/builder.rs +++ b/components/selectors/builder.rs @@ -142,7 +142,7 @@ impl SelectorBuilder { let iter = SelectorBuilderIter { current_simple_selectors: current.iter(), rest_of_simple_selectors: rest, - combinators: self.combinators.drain().rev(), + combinators: self.combinators.drain(..).rev(), }; Arc::into_thin(Arc::from_header_and_iter(header, iter)) @@ -152,7 +152,7 @@ impl SelectorBuilder { struct SelectorBuilderIter<'a, Impl: SelectorImpl> { current_simple_selectors: slice::Iter<'a, Component>, rest_of_simple_selectors: &'a [Component], - combinators: iter::Rev>, + combinators: iter::Rev>, } impl<'a, Impl: SelectorImpl> ExactSizeIterator for SelectorBuilderIter<'a, Impl> { diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 7c1ae7b6780..6adb71e89d7 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -66,7 +66,7 @@ servo_arc = { path = "../servo_arc" } servo_atoms = {path = "../atoms", optional = true} servo_config = {path = "../config", optional = true} smallbitvec = "2.3.0" -smallvec = "0.6.6" +smallvec = "1.0" string_cache = { version = "0.8", optional = true } style_derive = {path = "../style_derive"} style_traits = {path = "../style_traits"} diff --git a/components/style/bloom.rs b/components/style/bloom.rs index a24dac42b2a..c17b31d1bee 100644 --- a/components/style/bloom.rs +++ b/components/style/bloom.rs @@ -216,7 +216,7 @@ impl StyleBloom { self.filter.clear(); self.pushed_hashes.clear(); } else { - for hash in self.pushed_hashes.drain() { + for hash in self.pushed_hashes.drain(..) { self.filter.remove_hash(hash); } debug_assert!(self.filter.is_zeroed()); @@ -233,7 +233,7 @@ impl StyleBloom { element = parent; } - for parent in parents_to_insert.drain().rev() { + for parent in parents_to_insert.drain(..).rev() { self.push(parent); } } @@ -374,7 +374,7 @@ impl StyleBloom { // Now the parents match, so insert the stack of elements we have been // collecting so far. - for parent in parents_to_insert.drain().rev() { + for parent in parents_to_insert.drain(..).rev() { self.push(parent); } diff --git a/components/style/invalidation/element/invalidator.rs b/components/style/invalidation/element/invalidator.rs index e094be281b4..f0f55595dff 100644 --- a/components/style/invalidation/element/invalidator.rs +++ b/components/style/invalidation/element/invalidator.rs @@ -698,7 +698,7 @@ where } } - sibling_invalidations.extend(new_sibling_invalidations.drain()); + sibling_invalidations.extend(new_sibling_invalidations.drain(..)); invalidated_self } diff --git a/components/style/parallel.rs b/components/style/parallel.rs index d4aa0af6acf..9e578e9e9e6 100644 --- a/components/style/parallel.rs +++ b/components/style/parallel.rs @@ -180,7 +180,7 @@ fn top_down_dom<'a, 'scope, E, D>( let mut traversal_data_copy = traversal_data.clone(); traversal_data_copy.current_dom_depth += 1; traverse_nodes( - discovered_child_nodes.drain(), + discovered_child_nodes.drain(..), DispatchMode::NotTailCall, recursion_ok, root, @@ -210,7 +210,7 @@ fn top_down_dom<'a, 'scope, E, D>( if !discovered_child_nodes.is_empty() { traversal_data.current_dom_depth += 1; traverse_nodes( - discovered_child_nodes.drain(), + discovered_child_nodes.drain(..), DispatchMode::TailCall, recursion_ok, root, diff --git a/components/style/properties/declaration_block.rs b/components/style/properties/declaration_block.rs index 930d4400d3d..90dec0a47d7 100644 --- a/components/style/properties/declaration_block.rs +++ b/components/style/properties/declaration_block.rs @@ -1433,7 +1433,7 @@ fn report_css_errors( selectors: Option<&SelectorList>, errors: &mut SmallParseErrorVec, ) { - for (error, slice, property) in errors.drain() { + for (error, slice, property) in errors.drain(..) { report_one_css_error(context, Some(block), selectors, error, slice, property) } } diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index 7cb153de375..0925e0f1c5b 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -345,7 +345,7 @@ impl RuleTree { important_author.sort_by_key(|&(_, order)| -order); } - for (source, shadow_cascade_order) in important_author.drain() { + for (source, shadow_cascade_order) in important_author.drain(..) { current = current.ensure_child( self.root.downgrade(), source, @@ -355,11 +355,11 @@ impl RuleTree { ); } - for source in important_user.drain() { + for source in important_user.drain(..) { current = current.ensure_child(self.root.downgrade(), source, UserImportant); } - for source in important_ua.drain() { + for source in important_ua.drain(..) { current = current.ensure_child(self.root.downgrade(), source, UAImportant); } @@ -378,7 +378,7 @@ impl RuleTree { guards: &StylesheetGuards, ) -> StrongRuleNode { self.insert_ordered_rules_with_important( - applicable_declarations.drain().map(|d| d.for_rule_tree()), + applicable_declarations.drain(..).map(|d| d.for_rule_tree()), guards, ) } @@ -556,7 +556,7 @@ impl RuleTree { // Now the rule is in the relevant place, push the children as // necessary. - let rule = self.insert_ordered_rules_from(current, children.drain().rev()); + let rule = self.insert_ordered_rules_from(current, children.drain(..).rev()); Some(rule) } @@ -593,7 +593,7 @@ impl RuleTree { } let rule = - self.insert_ordered_rules_from(last.parent().unwrap().clone(), children.drain().rev()); + self.insert_ordered_rules_from(last.parent().unwrap().clone(), children.drain(..).rev()); rule } diff --git a/components/style/stylist.rs b/components/style/stylist.rs index 56f36b9791f..9de1ec4e71b 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -1013,7 +1013,7 @@ impl Stylist { ); if !declarations.is_empty() { let rule_node = self.rule_tree.insert_ordered_rules_with_important( - declarations.drain().map(|a| a.for_rule_tree()), + declarations.drain(..).map(|a| a.for_rule_tree()), guards, ); if rule_node != *self.rule_tree.root() { diff --git a/components/to_shmem/Cargo.toml b/components/to_shmem/Cargo.toml index dd3614111e1..76be7671da3 100644 --- a/components/to_shmem/Cargo.toml +++ b/components/to_shmem/Cargo.toml @@ -17,6 +17,6 @@ gecko = [] cssparser = "0.27" servo_arc = { path = "../servo_arc" } smallbitvec = "2.1.1" -smallvec = "0.6.6" +smallvec = "1.0" string_cache = { version = "0.8", optional = true } thin-slice = "0.1.0"