Skip to content

Commit 3c025b2

Browse files
committed
Remove unnecessary lets 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.
1 parent a335250 commit 3c025b2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/tests/async_iter/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ fn into_async_iter() {
77
let async_iter = async_iter::from_iter(0..3);
88
let mut async_iter = pin!(async_iter.into_async_iter());
99

10-
let waker = core::task::Waker::noop();
11-
let mut cx = &mut core::task::Context::from_waker(&waker);
10+
let mut cx = &mut core::task::Context::from_waker(core::task::Waker::noop());
1211

1312
assert_eq!(async_iter.as_mut().poll_next(&mut cx), Poll::Ready(Some(0)));
1413
assert_eq!(async_iter.as_mut().poll_next(&mut cx), Poll::Ready(Some(1)));

0 commit comments

Comments
 (0)