mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Update bool pattern matching into if-else
This commit is contained in:
parent
65370f17c9
commit
abd577bfd4
5 changed files with 50 additions and 49 deletions
|
@ -188,9 +188,10 @@ impl Event {
|
|||
}
|
||||
|
||||
pub fn status(&self) -> EventStatus {
|
||||
match self.DefaultPrevented() {
|
||||
true => EventStatus::Canceled,
|
||||
false => EventStatus::NotCanceled,
|
||||
if self.DefaultPrevented() {
|
||||
EventStatus::Canceled
|
||||
} else {
|
||||
EventStatus::NotCanceled
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -320,9 +321,10 @@ pub enum EventBubbles {
|
|||
|
||||
impl From<bool> for EventBubbles {
|
||||
fn from(boolean: bool) -> Self {
|
||||
match boolean {
|
||||
true => EventBubbles::Bubbles,
|
||||
false => EventBubbles::DoesNotBubble,
|
||||
if boolean {
|
||||
EventBubbles::Bubbles
|
||||
} else {
|
||||
EventBubbles::DoesNotBubble
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -344,9 +346,10 @@ pub enum EventCancelable {
|
|||
|
||||
impl From<bool> for EventCancelable {
|
||||
fn from(boolean: bool) -> Self {
|
||||
match boolean {
|
||||
true => EventCancelable::Cancelable,
|
||||
false => EventCancelable::NotCancelable,
|
||||
if boolean {
|
||||
EventCancelable::Cancelable
|
||||
} else {
|
||||
EventCancelable::NotCancelable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue