From ad1035f0a09dcf4cf88debc9f1044c51b3af8bbc Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 7 Jan 2016 10:37:45 +0100 Subject: [PATCH 1/2] Remove an unused argument to CustomEvent::init_custom_event. --- components/script/dom/customevent.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/script/dom/customevent.rs b/components/script/dom/customevent.rs index e30a50e53b8..f56e76ab7ff 100644 --- a/components/script/dom/customevent.rs +++ b/components/script/dom/customevent.rs @@ -44,7 +44,7 @@ impl CustomEvent { detail: HandleValue) -> Root { let ev = CustomEvent::new_uninitialized(global); - ev.init_custom_event(global.get_cx(), type_, bubbles, cancelable, detail); + ev.init_custom_event(type_, bubbles, cancelable, detail); ev } #[allow(unsafe_code)] @@ -60,7 +60,6 @@ impl CustomEvent { } fn init_custom_event(&self, - _cx: *mut JSContext, type_: Atom, can_bubble: bool, cancelable: bool, @@ -88,7 +87,7 @@ impl CustomEventMethods for CustomEvent { can_bubble: bool, cancelable: bool, detail: HandleValue) { - self.init_custom_event(_cx, Atom::from(&*type_), can_bubble, cancelable, detail) + self.init_custom_event(Atom::from(&*type_), can_bubble, cancelable, detail) } // https://dom.spec.whatwg.org/#dom-event-istrusted From a7afb25e9f122dbe17a88f598ce6b72e676c9d75 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 7 Jan 2016 10:38:57 +0100 Subject: [PATCH 2/2] Use Option::cloned() in HTMLCanvasElement::GetContext(). --- components/script/dom/htmlcanvaselement.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index b8d26b5ad3d..b0659eb003f 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -239,7 +239,7 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement { .map(CanvasRenderingContext2DOrWebGLRenderingContext::eCanvasRenderingContext2D) } "webgl" | "experimental-webgl" => { - self.get_or_init_webgl_context(cx, attributes.get(0).map(|p| *p)) + self.get_or_init_webgl_context(cx, attributes.get(0).cloned()) .map(CanvasRenderingContext2DOrWebGLRenderingContext::eWebGLRenderingContext) } _ => None