6161 html_logo_url = "https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png"
6262) ]
6363
64- use std:: future:: Future ;
64+ use std:: future:: { poll_fn , Future } ;
6565use std:: io:: { self , IoSlice , IoSliceMut , Read , Write } ;
6666use std:: net:: { SocketAddr , TcpListener , TcpStream , UdpSocket } ;
6767use std:: pin:: { pin, Pin } ;
@@ -80,7 +80,6 @@ use std::{
8080use std:: os:: windows:: io:: { AsRawSocket , AsSocket , BorrowedSocket , OwnedSocket , RawSocket } ;
8181
8282use futures_io:: { AsyncRead , AsyncWrite } ;
83- use futures_lite:: future;
8483use futures_lite:: stream:: { self , Stream } ;
8584
8685use rustix:: io as rio;
@@ -955,14 +954,14 @@ impl<T> Async<T> {
955954 ///
956955 /// ```no_run
957956 /// use async_io::Async;
958- /// use futures_lite ::future;
957+ /// use std ::future::poll_fn ;
959958 /// use std::net::TcpListener;
960959 ///
961960 /// # futures_lite::future::block_on(async {
962961 /// let mut listener = Async::<TcpListener>::bind(([127, 0, 0, 1], 0))?;
963962 ///
964963 /// // 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?;
966965 /// # std::io::Result::Ok(()) });
967966 /// ```
968967 pub fn poll_readable ( & self , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
@@ -986,15 +985,15 @@ impl<T> Async<T> {
986985 ///
987986 /// ```
988987 /// use async_io::Async;
989- /// use futures_lite ::future;
988+ /// use std ::future::poll_fn ;
990989 /// use std::net::{TcpStream, ToSocketAddrs};
991990 ///
992991 /// # futures_lite::future::block_on(async {
993992 /// let addr = "example.com:80".to_socket_addrs()?.next().unwrap();
994993 /// let stream = Async::<TcpStream>::connect(addr).await?;
995994 ///
996995 /// // 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?;
998997 /// # std::io::Result::Ok(()) });
999998 /// ```
1000999 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<()>
20592058 let mut polled = false ;
20602059 let mut fut = pin ! ( fut) ;
20612060
2062- future :: poll_fn ( |cx| {
2061+ poll_fn ( |cx| {
20632062 if !polled {
20642063 polled = true ;
20652064 fut. as_mut ( ) . poll ( cx)
0 commit comments