aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/custom_properties.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-10-04 14:45:43 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-10-04 14:51:53 +0200
commit583d89ac089ce1a8f3b5349e5633cd549ee59486 (patch)
tree9632b27b0290f1f0bd2d6495eb880a3fc4612988 /components/style/custom_properties.rs
parentf072c0bb05ddb9312223a069df9da67bfd887b91 (diff)
downloadservo-583d89ac089ce1a8f3b5349e5633cd549ee59486.tar.gz
servo-583d89ac089ce1a8f3b5349e5633cd549ee59486.zip
style: Use the OrderedMap iterator instead of doing our own thing.
Diffstat (limited to 'components/style/custom_properties.rs')
-rw-r--r--components/style/custom_properties.rs7
1 files 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(