mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #29061 - MichaelMcDonnell:fix-for-loop-over-option-warnings, r=jdm
Fix for loop over option warnings I fixed two for loop over an option warnings by using if let instead. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it is a simple code transformation. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
3cd030566e
1 changed files with 2 additions and 2 deletions
|
@ -437,7 +437,7 @@ impl EventTarget {
|
|||
let mut handlers = self.handlers.borrow_mut();
|
||||
|
||||
let listener = EventListenerType::Additive(listener.clone());
|
||||
for entries in handlers.get_mut(ty) {
|
||||
if let Some(entries) = handlers.get_mut(ty) {
|
||||
entries.drain_filter(|e| e.listener == listener && e.once);
|
||||
}
|
||||
}
|
||||
|
@ -734,7 +734,7 @@ impl EventTarget {
|
|||
};
|
||||
let mut handlers = self.handlers.borrow_mut();
|
||||
let entry = handlers.get_mut(&Atom::from(ty));
|
||||
for entry in entry {
|
||||
if let Some(entry) = entry {
|
||||
let phase = if options.capture {
|
||||
ListenerPhase::Capturing
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue