From 414d477b5482e44b47ab8034b158b2ad2e92bf27 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 31 Mar 2020 21:54:02 +0200 Subject: [PATCH] Don't generate rare_data_for_layout methods anymore It is only used twice. --- components/script/dom/element.rs | 5 +++-- components/script/dom/macros.rs | 5 ----- components/script/dom/node.rs | 5 +++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 48ef41cbff3..cca6ae7edbd 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -1039,8 +1039,9 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> { #[inline] #[allow(unsafe_code)] unsafe fn get_shadow_root_for_layout(self) -> Option> { - (*self.unsafe_get()) - .rare_data_for_layout() + self.unsafe_get() + .rare_data + .borrow_for_layout() .as_ref()? .shadow_root .as_ref() diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs index 1a2a17d652c..3969cb8bdd0 100644 --- a/components/script/dom/macros.rs +++ b/components/script/dom/macros.rs @@ -671,11 +671,6 @@ macro_rules! impl_rare_data ( rare_data.as_mut().unwrap() }) } - - #[allow(unsafe_code)] - fn rare_data_for_layout(&self) -> &Option> { - unsafe { self.rare_data.borrow_for_layout() } - } ); ); diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 251f6fcab18..61e164dbd12 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -1400,8 +1400,9 @@ impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node> { #[inline] #[allow(unsafe_code)] unsafe fn containing_shadow_root_for_layout(self) -> Option> { - (*self.unsafe_get()) - .rare_data_for_layout() + self.unsafe_get() + .rare_data + .borrow_for_layout() .as_ref()? .containing_shadow_root .as_ref()