aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglrenderingcontext.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-10-16 11:21:21 -0500
committerGitHub <noreply@github.com>2017-10-16 11:21:21 -0500
commita9022be0c3e30249845ca5947ac0c0a6743c7991 (patch)
tree00ce691d18ebd214fa85e811955db511d69ffec2 /components/script/dom/webglrenderingcontext.rs
parent5e3c4c21986b10ac7292d75245e57700f5075b1a (diff)
parentaa15dc269f41503d81ad44cd7e85d69e6f4aeac7 (diff)
downloadservo-a9022be0c3e30249845ca5947ac0c0a6743c7991.tar.gz
servo-a9022be0c3e30249845ca5947ac0c0a6743c7991.zip
Auto merge of #18900 - servo:box_syntax, r=emilio
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<T> Box<T> { #[inline(always)] pub fn new(x: T) -> Box<T> { box x } } ``` With inlining, it should compile to the same as box syntax. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18900) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r--components/script/dom/webglrenderingcontext.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index 30375b53c3f..c20b2273123 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -256,7 +256,7 @@ impl WebGLRenderingContext {
pub fn new(window: &Window, canvas: &HTMLCanvasElement, size: Size2D<i32>, attrs: GLContextAttributes)
-> Option<DomRoot<WebGLRenderingContext>> {
match WebGLRenderingContext::new_inherited(window, canvas, size, attrs) {
- Ok(ctx) => Some(reflect_dom_object(box ctx, window, WebGLRenderingContextBinding::Wrap)),
+ Ok(ctx) => Some(reflect_dom_object(Box::new(ctx), window, WebGLRenderingContextBinding::Wrap)),
Err(msg) => {
error!("Couldn't create WebGLRenderingContext: {}", msg);
let event = WebGLContextEvent::new(window,