aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/event.rs')
-rw-r--r--components/script/dom/event.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/components/script/dom/event.rs b/components/script/dom/event.rs
index 61b9b14877e..fc18036bfc7 100644
--- a/components/script/dom/event.rs
+++ b/components/script/dom/event.rs
@@ -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
}
}
}