mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #7631 - jxs:rewrite_uses_of_map, r=jdm
rewrite uses of map as if let in the end only found this case as re-writable, am i missing some? <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7631) <!-- Reviewable:end -->
This commit is contained in:
commit
e3d36bfceb
1 changed files with 10 additions and 3 deletions
|
@ -798,12 +798,19 @@ impl Document {
|
|||
match key {
|
||||
Key::Space if !prevented && state == KeyState::Released => {
|
||||
let maybe_elem: Option<&Element> = ElementCast::to_ref(target);
|
||||
maybe_elem.map(
|
||||
|el| el.as_maybe_activatable().map(|a| a.synthetic_click_activation(ctrl, alt, shift, meta)));
|
||||
if let Some(el) = maybe_elem {
|
||||
if let Some(a) = el.as_maybe_activatable() {
|
||||
a.synthetic_click_activation(ctrl, alt, shift, meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
Key::Enter if !prevented && state == KeyState::Released => {
|
||||
let maybe_elem: Option<&Element> = ElementCast::to_ref(target);
|
||||
maybe_elem.map(|el| el.as_maybe_activatable().map(|a| a.implicit_submission(ctrl, alt, shift, meta)));
|
||||
if let Some(el) = maybe_elem {
|
||||
if let Some(a) = el.as_maybe_activatable() {
|
||||
a.implicit_submission(ctrl, alt, shift, meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => ()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue