mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-24 00:00:11 +02:00
Fix new clippy warning (#2899)
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -124,7 +124,6 @@ struct State(usize);
|
||||
/// }
|
||||
/// ```
|
||||
pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
|
||||
#[allow(deprecated)]
|
||||
let inner = Arc::new(Inner {
|
||||
state: AtomicUsize::new(State::new().as_usize()),
|
||||
value: UnsafeCell::new(None),
|
||||
|
||||
Reference in New Issue
Block a user