aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/rtcdatachannel.rs
diff options
context:
space:
mode:
authorOluwatobi Sofela <60105594+oluwatobiss@users.noreply.github.com>2024-03-26 15:01:10 +0100
committerGitHub <noreply@github.com>2024-03-26 14:01:10 +0000
commitb71de9256911e1e29006cf1c1a782bda5c4c8968 (patch)
treeb8b6336477c5dfbe1e90fc336da4392f763822ad /components/script/dom/rtcdatachannel.rs
parentd16f259e1d3c7b8c0c0f4692af41ba2e41085e23 (diff)
downloadservo-b71de9256911e1e29006cf1c1a782bda5c4c8968.tar.gz
servo-b71de9256911e1e29006cf1c1a782bda5c4c8968.zip
clippy: Fix single_match warnings (#31876)
Diffstat (limited to 'components/script/dom/rtcdatachannel.rs')
-rw-r--r--components/script/dom/rtcdatachannel.rs19
1 files changed, 8 insertions, 11 deletions
diff --git a/components/script/dom/rtcdatachannel.rs b/components/script/dom/rtcdatachannel.rs
index 87429be677c..36c1cab92db 100644
--- a/components/script/dom/rtcdatachannel.rs
+++ b/components/script/dom/rtcdatachannel.rs
@@ -200,17 +200,14 @@ impl RTCDataChannel {
}
pub fn on_state_change(&self, state: DataChannelState) {
- match state {
- DataChannelState::Closing => {
- let event = Event::new(
- &self.global(),
- atom!("closing"),
- EventBubbles::DoesNotBubble,
- EventCancelable::NotCancelable,
- );
- event.upcast::<Event>().fire(self.upcast());
- },
- _ => {},
+ if let DataChannelState::Closing = state {
+ let event = Event::new(
+ &self.global(),
+ atom!("closing"),
+ EventBubbles::DoesNotBubble,
+ EventCancelable::NotCancelable,
+ );
+ event.upcast::<Event>().fire(self.upcast());
};
self.ready_state.set(state.into());
}