From 5c71b925fb8dd833243eb4e1ca99b80359596f51 Mon Sep 17 00:00:00 2001 From: jahielkomu Date: Sun, 31 Mar 2024 20:14:54 +0300 Subject: [PATCH] Updated fixes to clippy warnings in components/script --- components/script/dom/window.rs | 1 + components/script/layout_dom/node.rs | 3 --- components/script/layout_dom/shadow_root.rs | 4 +--- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index efb18a8d285..0dd190ef2f1 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -2520,6 +2520,7 @@ impl Window { impl Window { #[allow(unsafe_code)] + #[allow(clippy::too_many_arguments)] pub fn new( runtime: Rc, script_chan: MainThreadScriptChan, diff --git a/components/script/layout_dom/node.rs b/components/script/layout_dom/node.rs index 6fb20bc13b3..c331f4aa5e3 100644 --- a/components/script/layout_dom/node.rs +++ b/components/script/layout_dom/node.rs @@ -98,9 +98,6 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ServoLayoutNode<'dom, LayoutDataType } } - /// # Safety - /// - /// This function should not be called if there is no TrustedNodeAddress. pub unsafe fn new(address: &TrustedNodeAddress) -> Self { ServoLayoutNode::from_layout_js(LayoutDom::from_trusted_node_address(*address)) } diff --git a/components/script/layout_dom/shadow_root.rs b/components/script/layout_dom/shadow_root.rs index de2da7a030f..2d3d6d0d618 100644 --- a/components/script/layout_dom/shadow_root.rs +++ b/components/script/layout_dom/shadow_root.rs @@ -70,9 +70,7 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ServoShadowRoot<'dom, LayoutDataType phantom: PhantomData, } } - /// # Safety - /// - /// This function should not mutate StyleSharedRwLockReadGuard. + pub unsafe fn flush_stylesheets( &self, stylist: &mut Stylist,