diff options
Diffstat (limited to 'tests/oneshot.rs')
-rw-r--r-- | tests/oneshot.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/oneshot.rs b/tests/oneshot.rs index c9f5508..6b48376 100644 --- a/tests/oneshot.rs +++ b/tests/oneshot.rs @@ -35,10 +35,7 @@ fn cancel_notifies() { #[test] fn cancel_lots() { - #[cfg(miri)] - const N: usize = 100; - #[cfg(not(miri))] - const N: usize = 20000; + const N: usize = if cfg!(miri) { 100 } else { 20000 }; let (tx, rx) = mpsc::channel::<(Sender<_>, mpsc::Sender<_>)>(); let t = thread::spawn(move || { @@ -106,10 +103,7 @@ fn is_canceled() { #[test] fn cancel_sends() { - #[cfg(miri)] - const N: usize = 100; - #[cfg(not(miri))] - const N: usize = 20000; + const N: usize = if cfg!(miri) { 100 } else { 20000 }; let (tx, rx) = mpsc::channel::<Sender<_>>(); let t = thread::spawn(move || { |