From aa15dc269f41503d81ad44cd7e85d69e6f4aeac7 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 16 Oct 2017 14:35:30 +0200 Subject: Remove use of unstable box syntax. http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl Box { #[inline(always)] pub fn new(x: T) -> Box { box x } } ``` With inlining, it should compile to the same as box syntax. --- components/script/dom/webglcontextevent.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components/script/dom/webglcontextevent.rs') diff --git a/components/script/dom/webglcontextevent.rs b/components/script/dom/webglcontextevent.rs index 3e28af76d6e..aeec60f8cf1 100644 --- a/components/script/dom/webglcontextevent.rs +++ b/components/script/dom/webglcontextevent.rs @@ -48,7 +48,7 @@ impl WebGLContextEvent { // available. let status_message = DOMString::new(); reflect_dom_object( - box WebGLContextEvent::new_inherited(status_message), + Box::new(WebGLContextEvent::new_inherited(status_message)), window, WebGLContextEventBinding::Wrap) } @@ -59,7 +59,7 @@ impl WebGLContextEvent { cancelable: EventCancelable, status_message: DOMString) -> DomRoot { let event = reflect_dom_object( - box WebGLContextEvent::new_inherited(status_message), + Box::new(WebGLContextEvent::new_inherited(status_message)), window, WebGLContextEventBinding::Wrap); -- cgit v1.2.3