Remove unnecessary let
s and borrowing from Waker::noop()
usage.
`Waker::noop()` now returns a `&'static Waker` reference, so it can be passed directly to `Context` creation with no temporary lifetime issue.
This commit is contained in:
parent
6f8a944ba4
commit
c48cdfe8ee
22 changed files with 24 additions and 46 deletions
|
@ -7,8 +7,7 @@ fn into_async_iter() {
|
|||
let async_iter = async_iter::from_iter(0..3);
|
||||
let mut async_iter = pin!(async_iter.into_async_iter());
|
||||
|
||||
let waker = core::task::Waker::noop();
|
||||
let mut cx = &mut core::task::Context::from_waker(&waker);
|
||||
let mut cx = &mut core::task::Context::from_waker(core::task::Waker::noop());
|
||||
|
||||
assert_eq!(async_iter.as_mut().poll_next(&mut cx), Poll::Ready(Some(0)));
|
||||
assert_eq!(async_iter.as_mut().poll_next(&mut cx), Poll::Ready(Some(1)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue