From 496e8899172a39eb8b2cff0f2462141ddc6b575d Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Thu, 1 Oct 2020 23:59:48 +0200 Subject: [PATCH] Fix new clippy warning (#2899) --- tokio/src/sync/batch_semaphore.rs | 2 +- tokio/src/sync/oneshot.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tokio/src/sync/batch_semaphore.rs b/tokio/src/sync/batch_semaphore.rs index 6305485b0..148e83160 100644 --- a/tokio/src/sync/batch_semaphore.rs +++ b/tokio/src/sync/batch_semaphore.rs @@ -133,7 +133,7 @@ impl Semaphore { pub(crate) const fn const_new(mut permits: usize) -> Self { // NOTE: assertions and by extension panics are still being worked on: https://github.com/rust-lang/rust/issues/74925 // currently we just clamp the permit count when it exceeds the max - permits = permits & Self::MAX_PERMITS; + permits &= Self::MAX_PERMITS; Self { permits: AtomicUsize::new(permits << Self::PERMIT_SHIFT), diff --git a/tokio/src/sync/oneshot.rs b/tokio/src/sync/oneshot.rs index 17767e7f7..32506bc34 100644 --- a/tokio/src/sync/oneshot.rs +++ b/tokio/src/sync/oneshot.rs @@ -124,7 +124,6 @@ struct State(usize); /// } /// ``` pub fn channel() -> (Sender, Receiver) { - #[allow(deprecated)] let inner = Arc::new(Inner { state: AtomicUsize::new(State::new().as_usize()), value: UnsafeCell::new(None),