mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
async-await: Use Context instead of Waker in poll (#1041)
Rust nightly std::future::Future recently changed Waker to Context. Change to use Context Co-Authored-By: Kintaro <[email protected]>
This commit is contained in:
committed by
Carl Lerche
parent
9144b2ff53
commit
7ae010f0f3
@@ -2,7 +2,7 @@ use futures::Stream;
|
||||
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Poll, Waker};
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
/// A future of the next element of a stream.
|
||||
#[derive(Debug)]
|
||||
@@ -21,7 +21,7 @@ impl<'a, T: Stream + Unpin> Next<'a, T> {
|
||||
impl<'a, T: Stream + Unpin> Future for Next<'a, T> {
|
||||
type Output = Option<Result<T::Item, T::Error>>;
|
||||
|
||||
fn poll(mut self: Pin<&mut Self>, _waker: &Waker) -> Poll<Self::Output> {
|
||||
fn poll(mut self: Pin<&mut Self>, _context: &mut Context) -> Poll<Self::Output> {
|
||||
use crate::compat::forward::convert_poll_stream;
|
||||
|
||||
convert_poll_stream(self.stream.poll())
|
||||
|
||||
Reference in New Issue
Block a user