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/task_source/networking.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components/script/task_source/networking.rs') diff --git a/components/script/task_source/networking.rs b/components/script/task_source/networking.rs index 8b167c5d905..41795227e5d 100644 --- a/components/script/task_source/networking.rs +++ b/components/script/task_source/networking.rs @@ -26,7 +26,7 @@ impl TaskSource for NetworkingTaskSource { { self.0.send(CommonScriptMsg::Task( ScriptThreadEventCategory::NetworkEvent, - box canceller.wrap_task(task), + Box::new(canceller.wrap_task(task)), )) } } @@ -40,7 +40,7 @@ impl NetworkingTaskSource { { self.0.send(CommonScriptMsg::Task( ScriptThreadEventCategory::NetworkEvent, - box task, + Box::new(task), )) } } -- cgit v1.2.3