diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2015-08-27 22:15:54 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2015-08-27 22:27:43 +0200 |
commit | 709d347872e37ab2358e057d24557b9977238ecd (patch) | |
tree | 89f726bf207325eea8a8ca316f6d77d8c88432cb /components/script/dom/htmlcollection.rs | |
parent | 856fda7f2e3fe4abd6de247e8bdaf8cedf3764c2 (diff) | |
download | servo-709d347872e37ab2358e057d24557b9977238ecd.tar.gz servo-709d347872e37ab2358e057d24557b9977238ecd.zip |
Make the traits for the IDL interfaces take &self
Diffstat (limited to 'components/script/dom/htmlcollection.rs')
-rw-r--r-- | components/script/dom/htmlcollection.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index 19274579eea..eca49ed6f56 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -192,19 +192,19 @@ impl<'a> Iterator for HTMLCollectionElementsIter<'a> { } } -impl<'a> HTMLCollectionMethods for &'a HTMLCollection { +impl HTMLCollectionMethods for HTMLCollection { // https://dom.spec.whatwg.org/#dom-htmlcollection-length - fn Length(self) -> u32 { + fn Length(&self) -> u32 { self.elements_iter().count() as u32 } // https://dom.spec.whatwg.org/#dom-htmlcollection-item - fn Item(self, index: u32) -> Option<Root<Element>> { + fn Item(&self, index: u32) -> Option<Root<Element>> { self.elements_iter().nth(index as usize) } // https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem - fn NamedItem(self, key: DOMString) -> Option<Root<Element>> { + fn NamedItem(&self, key: DOMString) -> Option<Root<Element>> { // Step 1. if key.is_empty() { return None; @@ -218,21 +218,21 @@ impl<'a> HTMLCollectionMethods for &'a HTMLCollection { } // https://dom.spec.whatwg.org/#dom-htmlcollection-item - fn IndexedGetter(self, index: u32, found: &mut bool) -> Option<Root<Element>> { + fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Root<Element>> { let maybe_elem = self.Item(index); *found = maybe_elem.is_some(); maybe_elem } // check-tidy: no specs after this line - fn NamedGetter(self, name: DOMString, found: &mut bool) -> Option<Root<Element>> { + fn NamedGetter(&self, name: DOMString, found: &mut bool) -> Option<Root<Element>> { let maybe_elem = self.NamedItem(name); *found = maybe_elem.is_some(); maybe_elem } // https://dom.spec.whatwg.org/#interface-htmlcollection - fn SupportedPropertyNames(self) -> Vec<DOMString> { + fn SupportedPropertyNames(&self) -> Vec<DOMString> { // Step 1 let mut result = vec![]; |