Fixed some clippy warnings in components/script (#31950)

* Fixd some clippy warnings in components/script

* Update node.rs

Removed the  ```# Safety ``` section.

* Update shadow_root.rs

Removed the ``` # Safety ``` section from components/script/layout_dom

* Updated fixes to some clippy warnings in components/script

* Revert "Updated fixes to some clippy warnings in components/script"

This reverts commit 2a37c3dec8.

* Updated fixes to clippy warnings in components/script

* Revert "Updated fixes to clippy warnings in components/script"

This reverts commit 5780dc3a0a.

* Revert "Revert "Updated fixes to some clippy warnings in components/script""

This reverts commit 98c411354a.

* Revert "Updated fixes to some clippy warnings in components/script"

This reverts commit 2a37c3dec8.

* Update shadow_root.rs (Ignore change)

* Update node.rs (Ignore changes)

* Updated fixes to clippy warnings in components/script

* Removed  trailing white space in componets/script/layout_dom_root.rs

* Revert "Removed  trailing white space in componets/script/layout_dom_root.rs"

This reverts commit 1976fd0405.

* Revert "Updated fixes to clippy warnings in components/script"

This reverts commit 5c71b925fb.

* Updated fixes to clippy warnings in components/script including review suggestions.
This commit is contained in:
komuhangi 2024-03-31 22:51:16 +03:00 committed by GitHub
parent 8c8d68e415
commit c3360df918
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 9 deletions

View file

@ -2314,7 +2314,7 @@ impl Window {
self.Document().url() self.Document().url()
} }
pub fn with_layout<'a, T>(&self, call: impl FnOnce(&mut dyn Layout) -> T) -> Result<T, ()> { pub fn with_layout<T>(&self, call: impl FnOnce(&mut dyn Layout) -> T) -> Result<T, ()> {
ScriptThread::with_layout(self.pipeline_id(), call) ScriptThread::with_layout(self.pipeline_id(), call)
} }
@ -2414,9 +2414,7 @@ impl Window {
reply: IpcSender<Option<TimelineMarker>>, reply: IpcSender<Option<TimelineMarker>>,
) { ) {
*self.devtools_marker_sender.borrow_mut() = Some(reply); *self.devtools_marker_sender.borrow_mut() = Some(reply);
self.devtools_markers self.devtools_markers.borrow_mut().extend(markers);
.borrow_mut()
.extend(markers.into_iter());
} }
pub fn drop_devtools_timeline_markers(&self, markers: Vec<TimelineMarkerType>) { pub fn drop_devtools_timeline_markers(&self, markers: Vec<TimelineMarkerType>) {
@ -2522,6 +2520,7 @@ impl Window {
impl Window { impl Window {
#[allow(unsafe_code)] #[allow(unsafe_code)]
#[allow(clippy::too_many_arguments)]
pub fn new( pub fn new(
runtime: Rc<Runtime>, runtime: Rc<Runtime>,
script_chan: MainThreadScriptChan, script_chan: MainThreadScriptChan,

View file

@ -54,12 +54,12 @@ pub struct ServoLayoutNode<'dom, LayoutDataType: LayoutDataTrait> {
pub(super) phantom: PhantomData<LayoutDataType>, pub(super) phantom: PhantomData<LayoutDataType>,
} }
//// Those are supposed to be sound, but they aren't because the entire system /// Those are supposed to be sound, but they aren't because the entire system
//// between script and layout so far has been designed to work around their /// between script and layout so far has been designed to work around their
//// absence. Switching the entire thing to the inert crate infra will help. /// absence. Switching the entire thing to the inert crate infra will help.
/// ///
//// FIXME(mrobinson): These are required because Layout 2020 sends non-threadsafe /// FIXME(mrobinson): These are required because Layout 2020 sends non-threadsafe
//// nodes to different threads. This should be adressed in a comprehensive way. /// nodes to different threads. This should be adressed in a comprehensive way.
unsafe impl<LayoutDataType: LayoutDataTrait> Send for ServoLayoutNode<'_, LayoutDataType> {} unsafe impl<LayoutDataType: LayoutDataTrait> Send for ServoLayoutNode<'_, LayoutDataType> {}
unsafe impl<LayoutDataType: LayoutDataTrait> Sync for ServoLayoutNode<'_, LayoutDataType> {} unsafe impl<LayoutDataType: LayoutDataTrait> Sync for ServoLayoutNode<'_, LayoutDataType> {}