mirror of
https://github.com/servo/servo.git
synced 2025-06-25 01:24:37 +01:00
Use Option::or_else in eventdispatcher::dispatch_event.
This commit is contained in:
parent
d79c8a10cf
commit
315bf3b42a
1 changed files with 3 additions and 4 deletions
|
@ -17,10 +17,9 @@ pub fn dispatch_event(target: &JS<EventTarget>,
|
|||
|
||||
{
|
||||
let event = event.get_mut();
|
||||
event.target = match pseudo_target {
|
||||
Some(pseudo_target) => Some(pseudo_target),
|
||||
None => Some(target.clone())
|
||||
};
|
||||
event.target = pseudo_target.or_else(|| {
|
||||
Some(target.clone())
|
||||
});
|
||||
event.dispatching = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue