aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/characterdata.rs
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@mozilla.com>2014-09-19 01:32:30 -0700
committerCameron Zwarich <zwarich@mozilla.com>2014-09-20 11:54:10 -0700
commit2c8d51a37c84fb5de531d00c45de9c0020930b11 (patch)
tree9d65c2f2141edf9bd8b47bb785b7e948e092f831 /components/script/dom/characterdata.rs
parent2adc594e5d8babaadbe1a4e05a8f7d808313728f (diff)
downloadservo-2c8d51a37c84fb5de531d00c45de9c0020930b11.tar.gz
servo-2c8d51a37c84fb5de531d00c45de9c0020930b11.zip
More progress in the &JSRef -> JSRef conversion
Change all of the <Class>Methods traits to take `self` instead of `&self`.
Diffstat (limited to 'components/script/dom/characterdata.rs')
-rw-r--r--components/script/dom/characterdata.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs
index a7ac4a2d631..14c1123f1bd 100644
--- a/components/script/dom/characterdata.rs
+++ b/components/script/dom/characterdata.rs
@@ -45,37 +45,37 @@ impl CharacterData {
}
impl<'a> CharacterDataMethods for JSRef<'a, CharacterData> {
- fn Data(&self) -> DOMString {
+ fn Data(self) -> DOMString {
self.data.deref().borrow().clone()
}
- fn SetData(&self, arg: DOMString) -> ErrorResult {
+ fn SetData(self, arg: DOMString) -> ErrorResult {
*self.data.deref().borrow_mut() = arg;
Ok(())
}
- fn Length(&self) -> u32 {
+ fn Length(self) -> u32 {
self.data.deref().borrow().len() as u32
}
- fn SubstringData(&self, offset: u32, count: u32) -> Fallible<DOMString> {
+ fn SubstringData(self, offset: u32, count: u32) -> Fallible<DOMString> {
Ok(self.data.deref().borrow().as_slice().slice(offset as uint, count as uint).to_string())
}
- fn AppendData(&self, arg: DOMString) -> ErrorResult {
+ fn AppendData(self, arg: DOMString) -> ErrorResult {
self.data.deref().borrow_mut().push_str(arg.as_slice());
Ok(())
}
- fn InsertData(&self, offset: u32, arg: DOMString) -> ErrorResult {
+ fn InsertData(self, offset: u32, arg: DOMString) -> ErrorResult {
self.ReplaceData(offset, 0, arg)
}
- fn DeleteData(&self, offset: u32, count: u32) -> ErrorResult {
+ fn DeleteData(self, offset: u32, count: u32) -> ErrorResult {
self.ReplaceData(offset, count, "".to_string())
}
- fn ReplaceData(&self, offset: u32, count: u32, arg: DOMString) -> ErrorResult {
+ fn ReplaceData(self, offset: u32, count: u32, arg: DOMString) -> ErrorResult {
let length = self.data.deref().borrow().len() as u32;
if offset > length {
return Err(IndexSize);
@@ -94,8 +94,8 @@ impl<'a> CharacterDataMethods for JSRef<'a, CharacterData> {
}
// http://dom.spec.whatwg.org/#dom-childnode-remove
- fn Remove(&self) {
- let node: JSRef<Node> = NodeCast::from_ref(*self);
+ fn Remove(self) {
+ let node: JSRef<Node> = NodeCast::from_ref(self);
node.remove_self();
}
}