Update bool pattern matching into if-else

This commit is contained in:
Piotr Szpetkowski 2019-01-30 20:54:12 +01:00
parent 65370f17c9
commit abd577bfd4
No known key found for this signature in database
GPG key ID: D3FEC6AE666BC5B1
5 changed files with 50 additions and 49 deletions

View file

@ -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
}
}
}