clippy: Fix toplevel_ref_arg warning in components/script (#31984)

* clippy: Fix toplevel_ref_arg warnings

* refactor: Make the let binding more idiomatic
This commit is contained in:
Oluwatobi Sofela 2024-04-03 19:54:28 +01:00 committed by GitHub
parent 37cf4cf207
commit fcc7a1be53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -731,9 +731,8 @@ impl EventTarget {
listener: Option<Rc<EventListener>>,
options: EventListenerOptions,
) {
let ref listener = match listener {
Some(l) => l,
None => return,
let Some(ref listener) = listener else {
return;
};
let mut handlers = self.handlers.borrow_mut();
let entry = handlers.get_mut(&Atom::from(ty));