Skip to content

Commit 2bee1db

Browse files
committed
Fix clippy::unit_arg warning in test
``` warning: passing a unit value to a function --> tests/panic.rs:134:44 | 134 | future::block_on(future::or(&mut task, future::ready(Default::default()))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(clippy::unit_arg)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg help: move the expression in front of the call and replace it with the unit literal `()` | 134 ~ future::block_on(future::or(&mut task, { 135 + Default::default(); 136 + future::ready(()) 137 ~ })); | warning: passing a unit value to a function --> tests/panic.rs:200:52 | 200 | future::block_on(future::or(&mut task, future::ready(Default::default()))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg help: move the expression in front of the call and replace it with the unit literal `()` | 200 ~ future::block_on(future::or(&mut task, { 201 + Default::default(); 202 + future::ready(()) 203 ~ })); | ```
1 parent ceb5fc6 commit 2bee1db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/panic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fn try_join_and_run_and_join() {
131131
schedule!(s, SCHEDULE, DROP_S);
132132
let (runnable, mut task) = async_task::spawn(f, s);
133133

134-
future::block_on(future::or(&mut task, future::ready(Default::default())));
134+
future::block_on(future::or(&mut task, future::ready(())));
135135
assert_eq!(POLL.load(Ordering::SeqCst), 0);
136136
assert_eq!(SCHEDULE.load(Ordering::SeqCst), 0);
137137
assert_eq!(DROP_F.load(Ordering::SeqCst), 0);
@@ -197,7 +197,7 @@ fn try_join_during_run() {
197197
.add(|| {
198198
thread::sleep(ms(200));
199199

200-
future::block_on(future::or(&mut task, future::ready(Default::default())));
200+
future::block_on(future::or(&mut task, future::ready(())));
201201
assert_eq!(POLL.load(Ordering::SeqCst), 1);
202202
assert_eq!(SCHEDULE.load(Ordering::SeqCst), 0);
203203
assert_eq!(DROP_F.load(Ordering::SeqCst), 0);

0 commit comments

Comments
 (0)