From 400c7012b1fe73a2cf23653e4813b0f80181d069 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 27 Mar 2020 17:03:52 +0100 Subject: [PATCH] Make ServoLayoutNode::new return a free lifetime value Binding the scope of the ServoLayoutNode value to the originating TrustedNodeAddress is just theater. --- components/layout_thread/dom_wrapper.rs | 2 +- components/layout_thread_2020/dom_wrapper.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs index 5d9757e4ad0..0adb3ed4d6d 100644 --- a/components/layout_thread/dom_wrapper.rs +++ b/components/layout_thread/dom_wrapper.rs @@ -138,7 +138,7 @@ impl<'ln> ServoLayoutNode<'ln> { } } - pub unsafe fn new(address: &TrustedNodeAddress) -> ServoLayoutNode { + pub unsafe fn new(address: &TrustedNodeAddress) -> Self { ServoLayoutNode::from_layout_js(LayoutDom::from_trusted_node_address(*address)) } diff --git a/components/layout_thread_2020/dom_wrapper.rs b/components/layout_thread_2020/dom_wrapper.rs index 75a6ee0d9f3..8738a21bebb 100644 --- a/components/layout_thread_2020/dom_wrapper.rs +++ b/components/layout_thread_2020/dom_wrapper.rs @@ -145,7 +145,7 @@ impl<'ln> ServoLayoutNode<'ln> { } } - pub unsafe fn new(address: &TrustedNodeAddress) -> ServoLayoutNode { + pub unsafe fn new(address: &TrustedNodeAddress) -> Self { ServoLayoutNode::from_layout_js(LayoutDom::from_trusted_node_address(*address)) }