From 2c8d51a37c84fb5de531d00c45de9c0020930b11 Mon Sep 17 00:00:00 2001 From: Cameron Zwarich Date: Fri, 19 Sep 2014 01:32:30 -0700 Subject: More progress in the &JSRef -> JSRef conversion Change all of the Methods traits to take `self` instead of `&self`. --- components/script/dom/htmlcollection.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'components/script/dom/htmlcollection.rs') diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index d5de946acdd..6a4baf3f5dc 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -172,7 +172,7 @@ impl HTMLCollection { impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { // http://dom.spec.whatwg.org/#dom-htmlcollection-length - fn Length(&self) -> u32 { + fn Length(self) -> u32 { match self.collection { Static(ref elems) => elems.len() as u32, Live(ref root, ref filter) => { @@ -187,7 +187,7 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { } // http://dom.spec.whatwg.org/#dom-htmlcollection-item - fn Item(&self, index: u32) -> Option> { + fn Item(self, index: u32) -> Option> { match self.collection { Static(ref elems) => elems .as_slice() @@ -209,7 +209,7 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { } // http://dom.spec.whatwg.org/#dom-htmlcollection-nameditem - fn NamedItem(&self, key: DOMString) -> Option> { + fn NamedItem(self, key: DOMString) -> Option> { // Step 1. if key.is_empty() { return None; @@ -239,13 +239,13 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { } } - fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option> { + fn IndexedGetter(self, index: u32, found: &mut bool) -> Option> { let maybe_elem = self.Item(index); *found = maybe_elem.is_some(); maybe_elem } - fn NamedGetter(&self, name: DOMString, found: &mut bool) -> Option> { + fn NamedGetter(self, name: DOMString, found: &mut bool) -> Option> { let maybe_elem = self.NamedItem(name); *found = maybe_elem.is_some(); maybe_elem -- cgit v1.2.3