aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2015-11-02 16:04:24 +0100
committerMs2ger <Ms2ger@gmail.com>2015-11-02 16:04:50 +0100
commitd3d1f2b5c458e81c7596df0723dd75b28fe052f6 (patch)
tree50ed84247916514fa2e68b0ee81b68ac2470bb8e /components/script/dom
parent13291c4b64032931a38cd0671075287d87594732 (diff)
downloadservo-d3d1f2b5c458e81c7596df0723dd75b28fe052f6.tar.gz
servo-d3d1f2b5c458e81c7596df0723dd75b28fe052f6.zip
Simplify DOMTokenList::Item.
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/domtokenlist.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/components/script/dom/domtokenlist.rs b/components/script/dom/domtokenlist.rs
index c3944b7627c..4c2a9769c15 100644
--- a/components/script/dom/domtokenlist.rs
+++ b/components/script/dom/domtokenlist.rs
@@ -64,10 +64,7 @@ impl DOMTokenListMethods for DOMTokenList {
// https://dom.spec.whatwg.org/#dom-domtokenlist-item
fn Item(&self, index: u32) -> Option<DOMString> {
self.attribute().and_then(|attr| {
- let attr = attr.r();
- Some(attr.value().as_tokens()).and_then(|tokens| {
- tokens.get(index as usize).map(|token| (**token).to_owned())
- })
+ attr.value().as_tokens().get(index as usize).map(|token| (**token).to_owned())
})
}