Fix new clippy warning (#2899)

This commit is contained in:
Alice Ryhl
2020-10-02 00:59:48 +03:00
committed by GitHub
parent 53ccfc1fd6
commit 496e889917
2 changed files with 1 additions and 2 deletions
+1 -1
View File
@@ -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),
-1
View File
@@ -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),