aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/root.rs
diff options
context:
space:
mode:
authorRosemary Ajayi <okhuomonajayi54@gmail.com>2024-03-27 18:36:16 +0000
committerGitHub <noreply@github.com>2024-03-27 18:36:16 +0000
commita5bcae212a175d89507bffba7c57313b2cc9b3ab (patch)
tree583d9a21c8c6c8d40db433c2d0d12900701a6df7 /components/script/dom/bindings/root.rs
parentb476bbafde7193d2831cc9042cf73aec40a864e4 (diff)
downloadservo-a5bcae212a175d89507bffba7c57313b2cc9b3ab.tar.gz
servo-a5bcae212a175d89507bffba7c57313b2cc9b3ab.zip
clippy: Fix clippy problems in `components/script/dom` (#31891)
* deref on an immutable reference * use of with literal radix of 10 * fix
Diffstat (limited to 'components/script/dom/bindings/root.rs')
-rw-r--r--components/script/dom/bindings/root.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/bindings/root.rs b/components/script/dom/bindings/root.rs
index 088f93d12e0..906816f4812 100644
--- a/components/script/dom/bindings/root.rs
+++ b/components/script/dom/bindings/root.rs
@@ -64,7 +64,7 @@ where
pub unsafe fn new(value: T) -> Self {
unsafe fn add_to_root_list(object: *const dyn JSTraceable) -> *const RootCollection {
assert_in_script();
- STACK_ROOTS.with(|ref root_list| {
+ STACK_ROOTS.with(|root_list| {
let root_list = &*root_list.get().unwrap();
root_list.root(object);
root_list
@@ -208,7 +208,7 @@ where
T: DomObject,
{
fn clone(&self) -> DomRoot<T> {
- DomRoot::from_ref(&*self)
+ DomRoot::from_ref(self)
}
}
@@ -244,7 +244,7 @@ impl<'a> ThreadLocalStackRoots<'a> {
impl<'a> Drop for ThreadLocalStackRoots<'a> {
fn drop(&mut self) {
- STACK_ROOTS.with(|ref r| r.set(None));
+ STACK_ROOTS.with(|r| r.set(None));
}
}
@@ -282,7 +282,7 @@ impl RootCollection {
/// SM Callback that traces the rooted reflectors
pub unsafe fn trace_roots(tracer: *mut JSTracer) {
debug!("tracing stack roots");
- STACK_ROOTS.with(|ref collection| {
+ STACK_ROOTS.with(|collection| {
let collection = &*(*collection.get().unwrap()).roots.get();
for root in collection {
(**root).trace(tracer);