diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index e03534147fd4..3e856b63d0f1 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -82,14 +82,14 @@ impl TrustedPromise { /// lifetime. #[allow(crown::unrooted_must_root)] pub fn new(promise: Rc) -> TrustedPromise { - LIVE_REFERENCES.with(|ref r| { + LIVE_REFERENCES.with(|r| { let r = r.borrow(); let live_references = r.as_ref().unwrap(); let ptr = &*promise as *const Promise; live_references.addref_promise(promise); TrustedPromise { dom_object: ptr, - owner_thread: (&*live_references) as *const _ as *const libc::c_void, + owner_thread: (live_references) as *const _ as *const libc::c_void, } }) } @@ -98,12 +98,12 @@ impl TrustedPromise { /// a different thread than the original value from which this `TrustedPromise` was /// obtained. pub fn root(self) -> Rc { - LIVE_REFERENCES.with(|ref r| { + LIVE_REFERENCES.with(|r| { let r = r.borrow(); let live_references = r.as_ref().unwrap(); assert_eq!( self.owner_thread, - (&*live_references) as *const _ as *const libc::c_void + (live_references) as *const _ as *const libc::c_void ); // Borrow-check error requires the redundant `let promise = ...; promise` here. let promise = match live_references @@ -176,7 +176,7 @@ impl Trusted { fn add_live_reference( ptr: *const libc::c_void, ) -> (Arc, *const LiveDOMReferences) { - LIVE_REFERENCES.with(|ref r| { + LIVE_REFERENCES.with(|r| { let r = r.borrow(); let live_references = r.as_ref().unwrap(); let refcount = unsafe { live_references.addref(ptr) }; @@ -197,7 +197,7 @@ impl Trusted { /// obtained. pub fn root(&self) -> DomRoot { fn validate(owner_thread: *const LiveDOMReferences) { - assert!(LIVE_REFERENCES.with(|ref r| { + assert!(LIVE_REFERENCES.with(|r| { let r = r.borrow(); let live_references = r.as_ref().unwrap(); owner_thread == live_references @@ -230,7 +230,7 @@ pub struct LiveDOMReferences { impl LiveDOMReferences { /// Set up the thread-local data required for storing the outstanding DOM references. pub fn initialize() { - LIVE_REFERENCES.with(|ref r| { + LIVE_REFERENCES.with(|r| { *r.borrow_mut() = Some(LiveDOMReferences { reflectable_table: RefCell::new(HashMap::new()), promise_table: RefCell::new(HashMap::new()), @@ -239,7 +239,7 @@ impl LiveDOMReferences { } pub fn destruct() { - LIVE_REFERENCES.with(|ref r| { + LIVE_REFERENCES.with(|r| { *r.borrow_mut() = None; }); }