From 583d89ac089ce1a8f3b5349e5633cd549ee59486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 4 Oct 2017 14:45:43 +0200 Subject: [PATCH] style: Use the OrderedMap iterator instead of doing our own thing. --- components/style/custom_properties.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index 3590b10d133..40b0ce89f96 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -470,8 +470,7 @@ pub fn cascade<'a>( None => { let mut map = OrderedMap::new(); if let Some(inherited) = inherited { - for name in &inherited.index { - let inherited_value = inherited.get(name).unwrap(); + for (name, inherited_value) in inherited.iter() { map.insert(name, BorrowedSpecifiedValue { css: &inherited_value.css, first_token_type: inherited_value.first_token_type, @@ -575,9 +574,7 @@ fn substitute_all( ) -> CustomPropertiesMap { let mut custom_properties_map = CustomPropertiesMap::new(); let mut invalid = PrecomputedHashSet::default(); - for name in &specified_values_map.index { - let value = specified_values_map.get(name).unwrap(); - + for (name, value) in specified_values_map.iter() { // If this value is invalid at computed-time it won’t be inserted in computed_values_map. // Nothing else to do. let _ = substitute_one(