clippy: Fix clippy problems in components/script/dom (#31891)

* deref on an immutable reference

* use of  with literal radix of 10

* fix
This commit is contained in:
Rosemary Ajayi 2024-03-27 18:36:16 +00:00 committed by GitHub
parent b476bbafde
commit a5bcae212a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 13 deletions

View file

@ -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);