From ad22b29b2d426fa39e66a66f8be9130bdf1fc0a1 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Sat, 31 May 2014 23:40:24 +0900 Subject: [PATCH] Remove the implementation OptionalSettable for Option> to remove needless '&mut self'. --- src/components/script/dom/bindings/js.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/components/script/dom/bindings/js.rs b/src/components/script/dom/bindings/js.rs index c5d39959c8a..805adcf1ff3 100644 --- a/src/components/script/dom/bindings/js.rs +++ b/src/components/script/dom/bindings/js.rs @@ -260,20 +260,12 @@ impl Assignable for Temporary { /// Assign an optional rootable value (either of JS or Temporary) to an optional /// field of a DOM type (ie. Option>) pub trait OptionalSettable { - fn assign(&mut self, val: Option); -} - -impl, U: Reflectable> OptionalSettable for Option> { - fn assign(&mut self, val: Option) { - *self = val.map(|val| unsafe { val.get_js() }); - } + fn assign(&self, val: Option); } impl, U: Reflectable> OptionalSettable for Cell>> { - fn assign(&mut self, val: Option) { - let mut item = self.get(); - item.assign(val); - self.set(item); + fn assign(&self, val: Option) { + self.set(val.map(|val| unsafe { val.get_js() })); } }