61
61
html_logo_url = "https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png"
62
62
) ]
63
63
64
- use std:: future:: Future ;
64
+ use std:: future:: { poll_fn , Future } ;
65
65
use std:: io:: { self , IoSlice , IoSliceMut , Read , Write } ;
66
66
use std:: net:: { SocketAddr , TcpListener , TcpStream , UdpSocket } ;
67
67
use std:: pin:: { pin, Pin } ;
@@ -80,7 +80,6 @@ use std::{
80
80
use std:: os:: windows:: io:: { AsRawSocket , AsSocket , BorrowedSocket , OwnedSocket , RawSocket } ;
81
81
82
82
use futures_io:: { AsyncRead , AsyncWrite } ;
83
- use futures_lite:: future;
84
83
use futures_lite:: stream:: { self , Stream } ;
85
84
86
85
use rustix:: io as rio;
@@ -955,14 +954,14 @@ impl<T> Async<T> {
955
954
///
956
955
/// ```no_run
957
956
/// use async_io::Async;
958
- /// use futures_lite ::future;
957
+ /// use std ::future::poll_fn ;
959
958
/// use std::net::TcpListener;
960
959
///
961
960
/// # futures_lite::future::block_on(async {
962
961
/// let mut listener = Async::<TcpListener>::bind(([127, 0, 0, 1], 0))?;
963
962
///
964
963
/// // Wait until a client can be accepted.
965
- /// future:: poll_fn(|cx| listener.poll_readable(cx)).await?;
964
+ /// poll_fn(|cx| listener.poll_readable(cx)).await?;
966
965
/// # std::io::Result::Ok(()) });
967
966
/// ```
968
967
pub fn poll_readable ( & self , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
@@ -986,15 +985,15 @@ impl<T> Async<T> {
986
985
///
987
986
/// ```
988
987
/// use async_io::Async;
989
- /// use futures_lite ::future;
988
+ /// use std ::future::poll_fn ;
990
989
/// use std::net::{TcpStream, ToSocketAddrs};
991
990
///
992
991
/// # futures_lite::future::block_on(async {
993
992
/// let addr = "example.com:80".to_socket_addrs()?.next().unwrap();
994
993
/// let stream = Async::<TcpStream>::connect(addr).await?;
995
994
///
996
995
/// // Wait until the stream is writable.
997
- /// future:: poll_fn(|cx| stream.poll_writable(cx)).await?;
996
+ /// poll_fn(|cx| stream.poll_writable(cx)).await?;
998
997
/// # std::io::Result::Ok(()) });
999
998
/// ```
1000
999
pub fn poll_writable ( & self , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
@@ -2059,7 +2058,7 @@ async fn optimistic(fut: impl Future<Output = io::Result<()>>) -> io::Result<()>
2059
2058
let mut polled = false ;
2060
2059
let mut fut = pin ! ( fut) ;
2061
2060
2062
- future :: poll_fn ( |cx| {
2061
+ poll_fn ( |cx| {
2063
2062
if !polled {
2064
2063
polled = true ;
2065
2064
fut. as_mut ( ) . poll ( cx)
0 commit comments