4
4
#![ cfg_attr( feature = "cfg-target-has-atomic" , feature( cfg_target_has_atomic) ) ]
5
5
#![ cfg_attr( feature = "read-initializer" , feature( read_initializer) ) ]
6
6
#![ cfg_attr( feature = "write-all-vectored" , feature( io_slice_advance) ) ]
7
-
8
7
#![ 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
+ ) ]
10
14
// It cannot be included in the published code because this lints have false positives in the minimum required version.
11
15
#![ cfg_attr( test, warn( single_use_lifetimes) ) ]
12
16
#![ warn( clippy:: all) ]
13
-
14
17
// mem::take requires Rust 1.40, matches! requires Rust 1.42
15
18
// Can be removed if the minimum supported version increased or if https://github.com/rust-lang/rust-clippy/issues/3941
16
19
// get's implemented.
17
20
#![ allow( clippy:: mem_replace_with_default, clippy:: match_like_matches_macro) ]
18
-
19
21
#![ doc( test( attr( deny( warnings) , allow( dead_code, unused_assignments, unused_variables) ) ) ) ]
20
-
21
22
#![ cfg_attr( docsrs, feature( doc_cfg) ) ]
22
23
23
24
#[ cfg( all( feature = "cfg-target-has-atomic" , not( feature = "unstable" ) ) ) ]
@@ -49,7 +50,7 @@ pub use self::async_await::*;
49
50
pub mod __private {
50
51
pub use crate :: * ;
51
52
pub use core:: {
52
- option:: Option :: { self , Some , None } ,
53
+ option:: Option :: { self , None , Some } ,
53
54
pin:: Pin ,
54
55
result:: Result :: { Err , Ok } ,
55
56
} ;
@@ -76,10 +77,7 @@ macro_rules! delegate_sink {
76
77
self . project( ) . $field. poll_ready( cx)
77
78
}
78
79
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 > {
83
81
self . project( ) . $field. start_send( item)
84
82
}
85
83
@@ -96,7 +94,7 @@ macro_rules! delegate_sink {
96
94
) -> core:: task:: Poll <Result <( ) , Self :: Error >> {
97
95
self . project( ) . $field. poll_close( cx)
98
96
}
99
- }
97
+ } ;
100
98
}
101
99
102
100
macro_rules! delegate_future {
@@ -107,7 +105,7 @@ macro_rules! delegate_future {
107
105
) -> core:: task:: Poll <Self :: Output > {
108
106
self . project( ) . $field. poll( cx)
109
107
}
110
- }
108
+ } ;
111
109
}
112
110
113
111
macro_rules! delegate_stream {
@@ -121,34 +119,40 @@ macro_rules! delegate_stream {
121
119
fn size_hint( & self ) -> ( usize , Option <usize >) {
122
120
self . $field. size_hint( )
123
121
}
124
- }
122
+ } ;
125
123
}
126
124
127
125
#[ cfg( feature = "io" ) ]
128
126
#[ cfg( feature = "std" ) ]
129
127
macro_rules! delegate_async_write {
130
128
( $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 >> {
134
134
self . project( ) . $field. poll_write( cx, buf)
135
135
}
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 >> {
139
141
self . project( ) . $field. poll_write_vectored( cx, bufs)
140
142
}
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 <( ) >> {
144
147
self . project( ) . $field. poll_flush( cx)
145
148
}
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 <( ) >> {
149
153
self . project( ) . $field. poll_close( cx)
150
154
}
151
- }
155
+ } ;
152
156
}
153
157
154
158
#[ cfg( feature = "io" ) ]
@@ -160,18 +164,22 @@ macro_rules! delegate_async_read {
160
164
self . $field. initializer( )
161
165
}
162
166
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 >> {
166
172
self . project( ) . $field. poll_read( cx, buf)
167
173
}
168
174
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 >> {
172
180
self . project( ) . $field. poll_read_vectored( cx, bufs)
173
181
}
174
- }
182
+ } ;
175
183
}
176
184
177
185
#[ cfg( feature = "io" ) ]
@@ -188,7 +196,7 @@ macro_rules! delegate_async_buf_read {
188
196
fn consume( self : core:: pin:: Pin <& mut Self >, amt: usize ) {
189
197
self . project( ) . $field. consume( amt)
190
198
}
191
- }
199
+ } ;
192
200
}
193
201
194
202
macro_rules! delegate_access_inner {
@@ -304,16 +312,19 @@ macro_rules! delegate_all {
304
312
}
305
313
306
314
pub mod future;
307
- #[ doc( hidden) ] pub use crate :: future:: { FutureExt , TryFutureExt } ;
315
+ #[ doc( hidden) ]
316
+ pub use crate :: future:: { FutureExt , TryFutureExt } ;
308
317
309
318
pub mod stream;
310
- #[ doc( hidden) ] pub use crate :: stream:: { StreamExt , TryStreamExt } ;
319
+ #[ doc( hidden) ]
320
+ pub use crate :: stream:: { StreamExt , TryStreamExt } ;
311
321
312
322
#[ cfg( feature = "sink" ) ]
313
323
#[ cfg_attr( docsrs, doc( cfg( feature = "sink" ) ) ) ]
314
324
pub mod sink;
315
325
#[ cfg( feature = "sink" ) ]
316
- #[ doc( hidden) ] pub use crate :: sink:: SinkExt ;
326
+ #[ doc( hidden) ]
327
+ pub use crate :: sink:: SinkExt ;
317
328
318
329
pub mod task;
319
330
@@ -329,10 +340,11 @@ pub mod compat;
329
340
pub mod io;
330
341
#[ cfg( feature = "io" ) ]
331
342
#[ 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 } ;
333
345
334
346
mod fns;
335
-
347
+ mod unfold_state ;
336
348
337
349
cfg_target_has_atomic ! {
338
350
#[ cfg( feature = "alloc" ) ]
0 commit comments