diff options
author | Rosemary Ajayi <okhuomonajayi54@gmail.com> | 2024-03-25 12:57:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-25 12:57:35 +0000 |
commit | 3d10dbae32149515dc839d69bc2ba14f12b45251 (patch) | |
tree | b634b626cf3738318b00be3c25d372846c2f1cdd | |
parent | 97144ddf7104fd2cf8c1947db7f0d432754f37f5 (diff) | |
download | servo-3d10dbae32149515dc839d69bc2ba14f12b45251.tar.gz servo-3d10dbae32149515dc839d69bc2ba14f12b45251.zip |
clippy: Fix some clippy warnings in `components/script` (#31843)
* deref on an immutable reference
* fix deref on an immutable reference
* fix deref on an immutable reference
-rw-r--r-- | components/script/dom/servoparser/mod.rs | 4 | ||||
-rw-r--r-- | components/script/dom/windowproxy.rs | 6 | ||||
-rw-r--r-- | components/script/dom/workletglobalscope.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index acfb64aa069..d374a6e1de5 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -1187,7 +1187,7 @@ impl TreeSink for Sink { .GetParentNode() .expect("append_before_sibling called on node without parent"); - insert(&parent, Some(&*sibling), new_node, self.parsing_algorithm); + insert(&parent, Some(sibling), new_node, self.parsing_algorithm); } fn parse_error(&mut self, msg: Cow<'static, str>) { @@ -1253,7 +1253,7 @@ impl TreeSink for Sink { fn remove_from_parent(&mut self, target: &Dom<Node>) { if let Some(ref parent) = target.GetParentNode() { - parent.RemoveChild(&*target).unwrap(); + parent.RemoveChild(target).unwrap(); } } diff --git a/components/script/dom/windowproxy.rs b/components/script/dom/windowproxy.rs index fc925b6431e..25bcdfca00e 100644 --- a/components/script/dom/windowproxy.rs +++ b/components/script/dom/windowproxy.rs @@ -636,7 +636,7 @@ impl WindowProxy { ((*get_object_class(window_jsobject.get())).flags & JSCLASS_IS_GLOBAL), 0 ); - let _ac = enter_realm(&*window); + let _ac = enter_realm(window); // The old window proxy no longer owns this browsing context. SetProxyReservedSlot(old_js_proxy.get(), 0, &PrivateValue(ptr::null_mut())); @@ -681,7 +681,7 @@ impl WindowProxy { ); } } - self.set_window(&*globalscope, &PROXY_HANDLER); + self.set_window(globalscope, &PROXY_HANDLER); self.currently_active.set(Some(globalscope.pipeline_id())); } @@ -691,7 +691,7 @@ impl WindowProxy { } let globalscope = self.global(); let window = DissimilarOriginWindow::new(&globalscope, self); - self.set_window(&*window.upcast(), &XORIGIN_PROXY_HANDLER); + self.set_window(window.upcast(), &XORIGIN_PROXY_HANDLER); self.currently_active.set(None); } diff --git a/components/script/dom/workletglobalscope.rs b/components/script/dom/workletglobalscope.rs index 0e9a31a57a4..f364926f71c 100644 --- a/components/script/dom/workletglobalscope.rs +++ b/components/script/dom/workletglobalscope.rs @@ -92,7 +92,7 @@ impl WorkletGlobalScope { debug!("Evaluating Dom in a worklet."); rooted!(in (*GlobalScope::get_cx()) let mut rval = UndefinedValue()); self.globalscope.evaluate_js_on_global_with_result( - &*script, + script, rval.handle_mut(), ScriptFetchOptions::default_classic_script(&self.globalscope), self.globalscope.api_base_url(), |