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 ~             }));
    |
```
This commit is contained in:
Taiki Endo 2022-07-17 21:58:01 +09:00
parent ceb5fc6671
commit 2bee1db71a
1 changed files with 2 additions and 2 deletions

View File

@ -131,7 +131,7 @@ fn try_join_and_run_and_join() {
schedule!(s, SCHEDULE, DROP_S);
let (runnable, mut task) = async_task::spawn(f, s);
future::block_on(future::or(&mut task, future::ready(Default::default())));
future::block_on(future::or(&mut task, future::ready(())));
assert_eq!(POLL.load(Ordering::SeqCst), 0);
assert_eq!(SCHEDULE.load(Ordering::SeqCst), 0);
assert_eq!(DROP_F.load(Ordering::SeqCst), 0);
@ -197,7 +197,7 @@ fn try_join_during_run() {
.add(|| {
thread::sleep(ms(200));
future::block_on(future::or(&mut task, future::ready(Default::default())));
future::block_on(future::or(&mut task, future::ready(())));
assert_eq!(POLL.load(Ordering::SeqCst), 1);
assert_eq!(SCHEDULE.load(Ordering::SeqCst), 0);
assert_eq!(DROP_F.load(Ordering::SeqCst), 0);