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
|
@ -41,8 +41,7 @@
|
|||
LL| | #[coverage(off)]
|
||||
LL| | pub fn block_on<F: Future>(mut future: F) -> F::Output {
|
||||
LL| | let mut future = pin!(future);
|
||||
LL| | let waker = Waker::noop();
|
||||
LL| | let mut context = Context::from_waker(&waker);
|
||||
LL| | let mut context = Context::from_waker(Waker::noop());
|
||||
LL| |
|
||||
LL| | loop {
|
||||
LL| | if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue