diff options
Diffstat (limited to 'tokio/src/sync/batch_semaphore.rs')
-rw-r--r-- | tokio/src/sync/batch_semaphore.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tokio/src/sync/batch_semaphore.rs b/tokio/src/sync/batch_semaphore.rs index 6305485b..148e8316 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), |