diff options
author | bdonlan <bdonlan@gmail.com> | 2020-10-08 17:14:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-08 17:14:39 -0700 |
commit | b704c53b9cc76eaf8c9c6585f8444c4515d27728 (patch) | |
tree | 45d8037ebcd0c1a51b5afa5c0486752aebe103e3 /tokio/src/time | |
parent | 066965cd59d01fd9d999152e32169a24dfe434fa (diff) |
chore: Fix clippy lints (#2931)
Closes: #2929
Co-authored-by: Bryan Donlan <bdonlan@amazon.com>
Diffstat (limited to 'tokio/src/time')
-rw-r--r-- | tokio/src/time/error.rs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/tokio/src/time/error.rs b/tokio/src/time/error.rs index 2f93d671..a022f78f 100644 --- a/tokio/src/time/error.rs +++ b/tokio/src/time/error.rs @@ -40,10 +40,7 @@ impl Error { /// Returns `true` if the error was caused by the timer being shutdown. pub fn is_shutdown(&self) -> bool { - match self.0 { - Kind::Shutdown => true, - _ => false, - } + matches!(self.0, Kind::Shutdown) } /// Creates an error representing a timer at capacity. @@ -53,10 +50,7 @@ impl Error { /// Returns `true` if the error was caused by the timer being at capacity. pub fn is_at_capacity(&self) -> bool { - match self.0 { - Kind::AtCapacity => true, - _ => false, - } + matches!(self.0, Kind::AtCapacity) } /// Create an error representing a misconfigured timer. @@ -66,10 +60,7 @@ impl Error { /// Returns `true` if the error was caused by the timer being misconfigured. pub fn is_invalid(&self) -> bool { - match self.0 { - Kind::Invalid => true, - _ => false, - } + matches!(self.0, Kind::Invalid) } pub(crate) fn as_u8(&self) -> u8 { |