mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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:
parent
b476bbafde
commit
a5bcae212a
4 changed files with 12 additions and 13 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue