summaryrefslogtreecommitdiffstats
path: root/tokio/src/sync
diff options
context:
space:
mode:
authorbdonlan <bdonlan@gmail.com>2020-10-08 17:14:39 -0700
committerGitHub <noreply@github.com>2020-10-08 17:14:39 -0700
commitb704c53b9cc76eaf8c9c6585f8444c4515d27728 (patch)
tree45d8037ebcd0c1a51b5afa5c0486752aebe103e3 /tokio/src/sync
parent066965cd59d01fd9d999152e32169a24dfe434fa (diff)
chore: Fix clippy lints (#2931)
Closes: #2929 Co-authored-by: Bryan Donlan <bdonlan@amazon.com>
Diffstat (limited to 'tokio/src/sync')
-rw-r--r--tokio/src/sync/batch_semaphore.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/tokio/src/sync/batch_semaphore.rs b/tokio/src/sync/batch_semaphore.rs
index 148e8316..d09528be 100644
--- a/tokio/src/sync/batch_semaphore.rs
+++ b/tokio/src/sync/batch_semaphore.rs
@@ -527,20 +527,14 @@ impl TryAcquireError {
/// Returns `true` if the error was caused by a closed semaphore.
#[allow(dead_code)] // may be used later!
pub(crate) fn is_closed(&self) -> bool {
- match self {
- TryAcquireError::Closed => true,
- _ => false,
- }
+ matches!(self, TryAcquireError::Closed)
}
/// Returns `true` if the error was caused by calling `try_acquire` on a
/// semaphore with no available permits.
#[allow(dead_code)] // may be used later!
pub(crate) fn is_no_permits(&self) -> bool {
- match self {
- TryAcquireError::NoPermits => true,
- _ => false,
- }
+ matches!(self, TryAcquireError::NoPermits)
}
}