mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
More progress in the &JSRef -> JSRef conversion
Change all of the <Class>Methods traits to take `self` instead of `&self`.
This commit is contained in:
parent
2adc594e5d
commit
2c8d51a37c
66 changed files with 812 additions and 815 deletions
|
@ -56,22 +56,22 @@ impl FormData {
|
|||
|
||||
impl<'a> FormDataMethods for JSRef<'a, FormData> {
|
||||
#[allow(unrooted_must_root)]
|
||||
fn Append(&self, name: DOMString, value: JSRef<Blob>, filename: Option<DOMString>) {
|
||||
fn Append(self, name: DOMString, value: JSRef<Blob>, filename: Option<DOMString>) {
|
||||
let file = FileData(JS::from_rooted(self.get_file_from_blob(value, filename)));
|
||||
self.data.deref().borrow_mut().insert_or_update_with(name.clone(), vec!(file.clone()),
|
||||
|_k, v| {v.push(file.clone());});
|
||||
}
|
||||
|
||||
fn Append_(&self, name: DOMString, value: DOMString) {
|
||||
fn Append_(self, name: DOMString, value: DOMString) {
|
||||
self.data.deref().borrow_mut().insert_or_update_with(name, vec!(StringData(value.clone())),
|
||||
|_k, v| {v.push(StringData(value.clone()));});
|
||||
}
|
||||
|
||||
fn Delete(&self, name: DOMString) {
|
||||
fn Delete(self, name: DOMString) {
|
||||
self.data.deref().borrow_mut().remove(&name);
|
||||
}
|
||||
|
||||
fn Get(&self, name: DOMString) -> Option<FileOrString> {
|
||||
fn Get(self, name: DOMString) -> Option<FileOrString> {
|
||||
if self.data.deref().borrow().contains_key_equiv(&name) {
|
||||
match self.data.deref().borrow().get(&name)[0].clone() {
|
||||
StringData(ref s) => Some(eString(s.clone())),
|
||||
|
@ -84,16 +84,16 @@ impl<'a> FormDataMethods for JSRef<'a, FormData> {
|
|||
}
|
||||
}
|
||||
|
||||
fn Has(&self, name: DOMString) -> bool {
|
||||
fn Has(self, name: DOMString) -> bool {
|
||||
self.data.deref().borrow().contains_key_equiv(&name)
|
||||
}
|
||||
#[allow(unrooted_must_root)]
|
||||
fn Set(&self, name: DOMString, value: JSRef<Blob>, filename: Option<DOMString>) {
|
||||
fn Set(self, name: DOMString, value: JSRef<Blob>, filename: Option<DOMString>) {
|
||||
let file = FileData(JS::from_rooted(self.get_file_from_blob(value, filename)));
|
||||
self.data.deref().borrow_mut().insert(name, vec!(file));
|
||||
}
|
||||
|
||||
fn Set_(&self, name: DOMString, value: DOMString) {
|
||||
fn Set_(self, name: DOMString, value: DOMString) {
|
||||
self.data.deref().borrow_mut().insert(name, vec!(StringData(value)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue