diff options
author | chansuke <chansuke@georepublic.de> | 2018-09-18 23:24:15 +0900 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2018-09-19 17:40:47 -0400 |
commit | c37a345dc9f4dda6ea29c42f96f6c7201c42cbac (patch) | |
tree | 1f05b49bac02318455a59d5b143c186fd872bdb9 /components/script/dom/stylepropertymapreadonly.rs | |
parent | 2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff) | |
download | servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.tar.gz servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.zip |
Format script component
Diffstat (limited to 'components/script/dom/stylepropertymapreadonly.rs')
-rw-r--r-- | components/script/dom/stylepropertymapreadonly.rs | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/components/script/dom/stylepropertymapreadonly.rs b/components/script/dom/stylepropertymapreadonly.rs index 5948adfeb8d..c76a053f407 100644 --- a/components/script/dom/stylepropertymapreadonly.rs +++ b/components/script/dom/stylepropertymapreadonly.rs @@ -24,8 +24,9 @@ pub struct StylePropertyMapReadOnly { } impl StylePropertyMapReadOnly { - fn new_inherited<Entries>(entries: Entries) -> StylePropertyMapReadOnly where - Entries: IntoIterator<Item=(Atom, Dom<CSSStyleValue>)> + fn new_inherited<Entries>(entries: Entries) -> StylePropertyMapReadOnly + where + Entries: IntoIterator<Item = (Atom, Dom<CSSStyleValue>)>, { StylePropertyMapReadOnly { reflector: Reflector::new(), @@ -33,8 +34,12 @@ impl StylePropertyMapReadOnly { } } - pub fn from_iter<Entries>(global: &GlobalScope, entries: Entries) -> DomRoot<StylePropertyMapReadOnly> where - Entries: IntoIterator<Item=(Atom, String)>, + pub fn from_iter<Entries>( + global: &GlobalScope, + entries: Entries, + ) -> DomRoot<StylePropertyMapReadOnly> + where + Entries: IntoIterator<Item = (Atom, String)>, { let mut keys = Vec::new(); rooted_vec!(let mut values); @@ -48,7 +53,11 @@ impl StylePropertyMapReadOnly { values.push(Dom::from_ref(&*value)); } let iter = keys.drain(..).zip(values.iter().cloned()); - reflect_dom_object(Box::new(StylePropertyMapReadOnly::new_inherited(iter)), global, Wrap) + reflect_dom_object( + Box::new(StylePropertyMapReadOnly::new_inherited(iter)), + global, + Wrap, + ) } } @@ -56,7 +65,9 @@ impl StylePropertyMapReadOnlyMethods for StylePropertyMapReadOnly { /// <https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymapreadonly-get> fn Get(&self, property: DOMString) -> Option<DomRoot<CSSStyleValue>> { // TODO: avoid constructing an Atom - self.entries.get(&Atom::from(property)).map(|value| DomRoot::from_ref(&**value)) + self.entries + .get(&Atom::from(property)) + .map(|value| DomRoot::from_ref(&**value)) } /// <https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymapreadonly-has> @@ -67,7 +78,9 @@ impl StylePropertyMapReadOnlyMethods for StylePropertyMapReadOnly { /// <https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymapreadonly-getproperties> fn GetProperties(&self) -> Vec<DOMString> { - let mut result: Vec<DOMString> = self.entries.keys() + let mut result: Vec<DOMString> = self + .entries + .keys() .map(|key| DOMString::from(&**key)) .collect(); // https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-getproperties |