use matches! macro
As per the new clippy warnings.
diff --git a/src/frame.rs b/src/frame.rs
index 1c32b51..99708ca 100644
--- a/src/frame.rs
+++ b/src/frame.rs
@@ -680,14 +680,11 @@
}
pub fn ack_eliciting(&self) -> bool {
- match self {
- Frame::Padding { .. } |
+ // Any other frame is ack-eliciting (note the `!`).
+ !matches!(self, Frame::Padding { .. } |
Frame::ACK { .. } |
Frame::ApplicationClose { .. } |
- Frame::ConnectionClose { .. } => false,
-
- _ => true,
- }
+ Frame::ConnectionClose { .. })
}
#[cfg(feature = "qlog")]
diff --git a/src/lib.rs b/src/lib.rs
index b5759ad..f3a2533 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1037,13 +1037,12 @@
/// Returns true if the given protocol version is supported.
pub fn version_is_supported(version: u32) -> bool {
- match version {
+ matches!(
+ version,
PROTOCOL_VERSION_DRAFT27 |
- PROTOCOL_VERSION_DRAFT28 |
- PROTOCOL_VERSION_DRAFT29 => true,
-
- _ => false,
- }
+ PROTOCOL_VERSION_DRAFT28 |
+ PROTOCOL_VERSION_DRAFT29
+ )
}
/// Pushes a frame to the output packet if there is enough space.