diff options
Diffstat (limited to 'src/libstd/sync/mpsc/shared.rs')
| -rw-r--r-- | src/libstd/sync/mpsc/shared.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/sync/mpsc/shared.rs b/src/libstd/sync/mpsc/shared.rs index 2b0393573fd..fd9d61e99c2 100644 --- a/src/libstd/sync/mpsc/shared.rs +++ b/src/libstd/sync/mpsc/shared.rs @@ -12,7 +12,6 @@ use self::StartResult::*; use core::cmp; use core::intrinsics::abort; -use core::isize; use crate::cell::UnsafeCell; use crate::ptr; @@ -92,7 +91,7 @@ impl<T> Packet<T> { // // This can only be called at channel-creation time pub fn inherit_blocker(&self, token: Option<SignalToken>, guard: MutexGuard<'_, ()>) { - token.map(|token| { + if let Some(token) = token { assert_eq!(self.cnt.load(Ordering::SeqCst), 0); assert_eq!(self.to_wake.load(Ordering::SeqCst), 0); self.to_wake.store(unsafe { token.cast_to_usize() }, Ordering::SeqCst); @@ -119,7 +118,7 @@ impl<T> Packet<T> { unsafe { *self.steals.get() = -1; } - }); + } // When the shared packet is constructed, we grabbed this lock. The // purpose of this lock is to ensure that abort_selection() doesn't |
