mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
Simplify DOMTokenList::Item.
This commit is contained in:
parent
13291c4b64
commit
d3d1f2b5c4
1 changed files with 1 additions and 4 deletions
|
@ -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())
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue