summaryrefslogtreecommitdiffstats
path: root/tokio/src/runtime
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/runtime
parent066965cd59d01fd9d999152e32169a24dfe434fa (diff)
chore: Fix clippy lints (#2931)
Closes: #2929 Co-authored-by: Bryan Donlan <bdonlan@amazon.com>
Diffstat (limited to 'tokio/src/runtime')
-rw-r--r--tokio/src/runtime/enter.rs6
-rw-r--r--tokio/src/runtime/task/error.rs10
2 files changed, 3 insertions, 13 deletions
diff --git a/tokio/src/runtime/enter.rs b/tokio/src/runtime/enter.rs
index bb6e6be0..f934162b 100644
--- a/tokio/src/runtime/enter.rs
+++ b/tokio/src/runtime/enter.rs
@@ -13,11 +13,7 @@ pub(crate) enum EnterContext {
impl EnterContext {
pub(crate) fn is_entered(self) -> bool {
- if let EnterContext::Entered { .. } = self {
- true
- } else {
- false
- }
+ matches!(self, EnterContext::Entered { .. })
}
}
diff --git a/tokio/src/runtime/task/error.rs b/tokio/src/runtime/task/error.rs
index dfdec44c..509642d4 100644
--- a/tokio/src/runtime/task/error.rs
+++ b/tokio/src/runtime/task/error.rs
@@ -30,10 +30,7 @@ impl JoinError {
/// Returns true if the error was caused by the task being cancelled
pub fn is_cancelled(&self) -> bool {
- match &self.repr {
- Repr::Cancelled => true,
- _ => false,
- }
+ matches!(&self.repr, Repr::Cancelled)
}
/// Returns true if the error was caused by the task panicking
@@ -53,10 +50,7 @@ impl JoinError {
/// }
/// ```
pub fn is_panic(&self) -> bool {
- match &self.repr {
- Repr::Panic(_) => true,
- _ => false,
- }
+ matches!(&self.repr, Repr::Panic(_))
}
/// Consumes the join error, returning the object with which the task panicked.