aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlcollection.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmlcollection.rs')
-rw-r--r--components/script/dom/htmlcollection.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs
index 161e72ddc69..29cd1dfbb74 100644
--- a/components/script/dom/htmlcollection.rs
+++ b/components/script/dom/htmlcollection.rs
@@ -189,16 +189,17 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
// http://dom.spec.whatwg.org/#dom-htmlcollection-item
fn Item(self, index: u32) -> Option<Temporary<Element>> {
+ let index = index as usize;
match self.collection {
CollectionTypeId::Static(ref elems) => elems
.as_slice()
- .get(index as uint)
+ .get(index)
.map(|elem| Temporary::new(elem.clone())),
CollectionTypeId::Live(ref root, ref filter) => {
let root = root.root();
HTMLCollection::traverse(root.r())
.filter(|element| filter.filter(*element, root.r()))
- .nth(index as uint)
+ .nth(index)
.clone()
.map(Temporary::from_rooted)
}