clippy: Fix needless borrow warnings (#31813)

This commit is contained in:
Oluwatobi Sofela 2024-03-21 18:48:54 +01:00 committed by GitHub
parent 694e86ecff
commit 3e63f8d6ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 151 additions and 157 deletions

View file

@ -54,7 +54,7 @@ impl History {
state.set(NullValue());
History {
reflector_: Reflector::new(),
window: Dom::from_ref(&window),
window: Dom::from_ref(window),
state,
state_id: Cell::new(None),
}
@ -121,7 +121,7 @@ impl History {
};
let global_scope = self.window.upcast::<GlobalScope>();
rooted!(in(*GlobalScope::get_cx()) let mut state = UndefinedValue());
if let Err(_) = structuredclone::read(&global_scope, data, state.handle_mut()) {
if let Err(_) = structuredclone::read(global_scope, data, state.handle_mut()) {
warn!("Error reading structuredclone data");
}
self.state.set(state.get());
@ -270,7 +270,7 @@ impl History {
// Step 11
let global_scope = self.window.upcast::<GlobalScope>();
rooted!(in(*cx) let mut state = UndefinedValue());
if let Err(_) = structuredclone::read(&global_scope, serialized_data, state.handle_mut()) {
if let Err(_) = structuredclone::read(global_scope, serialized_data, state.handle_mut()) {
warn!("Error reading structuredclone data");
}