44#![ cfg_attr( feature = "cfg-target-has-atomic" , feature( cfg_target_has_atomic) ) ]
55#![ cfg_attr( feature = "read-initializer" , feature( read_initializer) ) ]
66#![ cfg_attr( feature = "write-all-vectored" , feature( io_slice_advance) ) ]
7-
87#![ cfg_attr( not( feature = "std" ) , no_std) ]
9- #![ warn( missing_docs, missing_debug_implementations, rust_2018_idioms, unreachable_pub) ]
8+ #![ warn(
9+ missing_docs,
10+ missing_debug_implementations,
11+ rust_2018_idioms,
12+ unreachable_pub
13+ ) ]
1014// It cannot be included in the published code because this lints have false positives in the minimum required version.
1115#![ cfg_attr( test, warn( single_use_lifetimes) ) ]
1216#![ warn( clippy:: all) ]
13-
1417// mem::take requires Rust 1.40, matches! requires Rust 1.42
1518// Can be removed if the minimum supported version increased or if https://github.com/rust-lang/rust-clippy/issues/3941
1619// get's implemented.
1720#![ allow( clippy:: mem_replace_with_default, clippy:: match_like_matches_macro) ]
18-
1921#![ doc( test( attr( deny( warnings) , allow( dead_code, unused_assignments, unused_variables) ) ) ) ]
20-
2122#![ cfg_attr( docsrs, feature( doc_cfg) ) ]
2223
2324#[ cfg( all( feature = "cfg-target-has-atomic" , not( feature = "unstable" ) ) ) ]
@@ -49,7 +50,7 @@ pub use self::async_await::*;
4950pub mod __private {
5051 pub use crate :: * ;
5152 pub use core:: {
52- option:: Option :: { self , Some , None } ,
53+ option:: Option :: { self , None , Some } ,
5354 pin:: Pin ,
5455 result:: Result :: { Err , Ok } ,
5556 } ;
@@ -76,10 +77,7 @@ macro_rules! delegate_sink {
7677 self . project( ) . $field. poll_ready( cx)
7778 }
7879
79- fn start_send(
80- self : core:: pin:: Pin <& mut Self >,
81- item: $item,
82- ) -> Result <( ) , Self :: Error > {
80+ fn start_send( self : core:: pin:: Pin <& mut Self >, item: $item) -> Result <( ) , Self :: Error > {
8381 self . project( ) . $field. start_send( item)
8482 }
8583
@@ -96,7 +94,7 @@ macro_rules! delegate_sink {
9694 ) -> core:: task:: Poll <Result <( ) , Self :: Error >> {
9795 self . project( ) . $field. poll_close( cx)
9896 }
99- }
97+ } ;
10098}
10199
102100macro_rules! delegate_future {
@@ -107,7 +105,7 @@ macro_rules! delegate_future {
107105 ) -> core:: task:: Poll <Self :: Output > {
108106 self . project( ) . $field. poll( cx)
109107 }
110- }
108+ } ;
111109}
112110
113111macro_rules! delegate_stream {
@@ -121,34 +119,40 @@ macro_rules! delegate_stream {
121119 fn size_hint( & self ) -> ( usize , Option <usize >) {
122120 self . $field. size_hint( )
123121 }
124- }
122+ } ;
125123}
126124
127125#[ cfg( feature = "io" ) ]
128126#[ cfg( feature = "std" ) ]
129127macro_rules! delegate_async_write {
130128 ( $field: ident) => {
131- fn poll_write( self : core:: pin:: Pin <& mut Self >, cx: & mut core:: task:: Context <' _>, buf: & [ u8 ] )
132- -> core:: task:: Poll <std:: io:: Result <usize >>
133- {
129+ fn poll_write(
130+ self : core:: pin:: Pin <& mut Self >,
131+ cx: & mut core:: task:: Context <' _>,
132+ buf: & [ u8 ] ,
133+ ) -> core:: task:: Poll <std:: io:: Result <usize >> {
134134 self . project( ) . $field. poll_write( cx, buf)
135135 }
136- fn poll_write_vectored( self : core:: pin:: Pin <& mut Self >, cx: & mut core:: task:: Context <' _>, bufs: & [ std:: io:: IoSlice <' _>] )
137- -> core:: task:: Poll <std:: io:: Result <usize >>
138- {
136+ fn poll_write_vectored(
137+ self : core:: pin:: Pin <& mut Self >,
138+ cx: & mut core:: task:: Context <' _>,
139+ bufs: & [ std:: io:: IoSlice <' _>] ,
140+ ) -> core:: task:: Poll <std:: io:: Result <usize >> {
139141 self . project( ) . $field. poll_write_vectored( cx, bufs)
140142 }
141- fn poll_flush( self : core:: pin:: Pin <& mut Self >, cx: & mut core:: task:: Context <' _>)
142- -> core:: task:: Poll <std:: io:: Result <( ) >>
143- {
143+ fn poll_flush(
144+ self : core:: pin:: Pin <& mut Self >,
145+ cx: & mut core:: task:: Context <' _>,
146+ ) -> core:: task:: Poll <std:: io:: Result <( ) >> {
144147 self . project( ) . $field. poll_flush( cx)
145148 }
146- fn poll_close( self : core:: pin:: Pin <& mut Self >, cx: & mut core:: task:: Context <' _>)
147- -> core:: task:: Poll <std:: io:: Result <( ) >>
148- {
149+ fn poll_close(
150+ self : core:: pin:: Pin <& mut Self >,
151+ cx: & mut core:: task:: Context <' _>,
152+ ) -> core:: task:: Poll <std:: io:: Result <( ) >> {
149153 self . project( ) . $field. poll_close( cx)
150154 }
151- }
155+ } ;
152156}
153157
154158#[ cfg( feature = "io" ) ]
@@ -160,18 +164,22 @@ macro_rules! delegate_async_read {
160164 self . $field. initializer( )
161165 }
162166
163- fn poll_read( self : core:: pin:: Pin <& mut Self >, cx: & mut core:: task:: Context <' _>, buf: & mut [ u8 ] )
164- -> core:: task:: Poll <std:: io:: Result <usize >>
165- {
167+ fn poll_read(
168+ self : core:: pin:: Pin <& mut Self >,
169+ cx: & mut core:: task:: Context <' _>,
170+ buf: & mut [ u8 ] ,
171+ ) -> core:: task:: Poll <std:: io:: Result <usize >> {
166172 self . project( ) . $field. poll_read( cx, buf)
167173 }
168174
169- fn poll_read_vectored( self : core:: pin:: Pin <& mut Self >, cx: & mut core:: task:: Context <' _>, bufs: & mut [ std:: io:: IoSliceMut <' _>] )
170- -> core:: task:: Poll <std:: io:: Result <usize >>
171- {
175+ fn poll_read_vectored(
176+ self : core:: pin:: Pin <& mut Self >,
177+ cx: & mut core:: task:: Context <' _>,
178+ bufs: & mut [ std:: io:: IoSliceMut <' _>] ,
179+ ) -> core:: task:: Poll <std:: io:: Result <usize >> {
172180 self . project( ) . $field. poll_read_vectored( cx, bufs)
173181 }
174- }
182+ } ;
175183}
176184
177185#[ cfg( feature = "io" ) ]
@@ -188,7 +196,7 @@ macro_rules! delegate_async_buf_read {
188196 fn consume( self : core:: pin:: Pin <& mut Self >, amt: usize ) {
189197 self . project( ) . $field. consume( amt)
190198 }
191- }
199+ } ;
192200}
193201
194202macro_rules! delegate_access_inner {
@@ -304,16 +312,19 @@ macro_rules! delegate_all {
304312}
305313
306314pub mod future;
307- #[ doc( hidden) ] pub use crate :: future:: { FutureExt , TryFutureExt } ;
315+ #[ doc( hidden) ]
316+ pub use crate :: future:: { FutureExt , TryFutureExt } ;
308317
309318pub mod stream;
310- #[ doc( hidden) ] pub use crate :: stream:: { StreamExt , TryStreamExt } ;
319+ #[ doc( hidden) ]
320+ pub use crate :: stream:: { StreamExt , TryStreamExt } ;
311321
312322#[ cfg( feature = "sink" ) ]
313323#[ cfg_attr( docsrs, doc( cfg( feature = "sink" ) ) ) ]
314324pub mod sink;
315325#[ cfg( feature = "sink" ) ]
316- #[ doc( hidden) ] pub use crate :: sink:: SinkExt ;
326+ #[ doc( hidden) ]
327+ pub use crate :: sink:: SinkExt ;
317328
318329pub mod task;
319330
@@ -329,10 +340,11 @@ pub mod compat;
329340pub mod io;
330341#[ cfg( feature = "io" ) ]
331342#[ cfg( feature = "std" ) ]
332- #[ doc( hidden) ] pub use crate :: io:: { AsyncReadExt , AsyncWriteExt , AsyncSeekExt , AsyncBufReadExt } ;
343+ #[ doc( hidden) ]
344+ pub use crate :: io:: { AsyncBufReadExt , AsyncReadExt , AsyncSeekExt , AsyncWriteExt } ;
333345
334346mod fns;
335-
347+ mod unfold_state ;
336348
337349cfg_target_has_atomic ! {
338350 #[ cfg( feature = "alloc" ) ]
0 commit comments