mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add fixes based on review.
- Use if let instead of match for Option - Refactor common code into pick_if_selected_and_reset
This commit is contained in:
parent
92e008307f
commit
4849033297
2 changed files with 19 additions and 22 deletions
|
@ -70,13 +70,12 @@ impl HTMLSelectElement {
|
|||
}
|
||||
}
|
||||
|
||||
match last_selected {
|
||||
Some(last_selected) => last_selected.set_selectedness(true),
|
||||
None => {
|
||||
if self.display_size() == 1 {
|
||||
if let Some(first_enabled) = first_enabled {
|
||||
first_enabled.set_selectedness(true);
|
||||
}
|
||||
if let Some(last_selected) = last_selected {
|
||||
last_selected.set_selectedness(true);
|
||||
} else {
|
||||
if self.display_size() == 1 {
|
||||
if let Some(first_enabled) = first_enabled {
|
||||
first_enabled.set_selectedness(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue