@@ -97,7 +97,7 @@ if_std! {
97
97
/// If reading would block, this function returns `Ok(Async::Pending)`
98
98
/// and arranges for `cx.waker()` to receive a notification when the
99
99
/// object becomes readable or is closed.
100
- fn poll_read( & mut self , buf : & mut [ u8 ] , cx : & mut task :: Context )
100
+ fn poll_read( & mut self , cx : & mut task :: Context , buf : & mut [ u8 ] )
101
101
-> Poll <usize , Error >;
102
102
103
103
/// Attempt to read from the `AsyncRead` into `vec` using vectored
@@ -113,11 +113,11 @@ if_std! {
113
113
/// If reading would block, this function returns `Ok(Async::Pending)`
114
114
/// and arranges for `cx.waker()` to receive a notification when the
115
115
/// object becomes readable or is closed.
116
- fn poll_vectored_read( & mut self , vec : & mut [ & mut IoVec ] , cx : & mut task :: Context )
116
+ fn poll_vectored_read( & mut self , cx : & mut task :: Context , vec : & mut [ & mut IoVec ] )
117
117
-> Poll <usize , Error >
118
118
{
119
- if let Some ( first_iovec) = vec. get_mut( 0 ) {
120
- self . poll_read( & mut * first_iovec , cx )
119
+ if let Some ( ref mut first_iovec) = vec. get_mut( 0 ) {
120
+ self . poll_read( cx , first_iovec )
121
121
} else {
122
122
// `vec` is empty.
123
123
return Ok ( Async :: Ready ( 0 ) ) ;
@@ -134,7 +134,7 @@ if_std! {
134
134
/// If writing would block, this function returns `Ok(Async::Pending)`
135
135
/// and arranges for `cx.waker()` to receive a notification when the
136
136
/// the object becomes writable or is closed.
137
- fn poll_write( & mut self , buf : & [ u8 ] , cx: & mut task:: Context )
137
+ fn poll_write( & mut self , cx: & mut task:: Context , buf : & [ u8 ] )
138
138
-> Poll <usize , Error >;
139
139
140
140
/// Attempt to write bytes from `vec` into the object using vectored
@@ -150,11 +150,11 @@ if_std! {
150
150
/// If writing would block, this function returns `Ok(Async::Pending)`
151
151
/// and arranges for `cx.waker()` to receive a notification when the
152
152
/// object becomes writable or is closed.
153
- fn poll_vectored_write( & mut self , vec : & [ & IoVec ] , cx: & mut task:: Context )
153
+ fn poll_vectored_write( & mut self , cx: & mut task:: Context , vec : & [ & IoVec ] )
154
154
-> Poll <usize , Error >
155
155
{
156
- if let Some ( first_iovec) = vec. get( 0 ) {
157
- self . poll_write( & * first_iovec, cx )
156
+ if let Some ( ref first_iovec) = vec. get( 0 ) {
157
+ self . poll_write( cx , & * first_iovec)
158
158
} else {
159
159
// `vec` is empty.
160
160
return Ok ( Async :: Ready ( 0 ) ) ;
@@ -187,16 +187,16 @@ if_std! {
187
187
( * * self ) . initializer( )
188
188
}
189
189
190
- fn poll_read( & mut self , buf : & mut [ u8 ] , cx : & mut task :: Context )
190
+ fn poll_read( & mut self , cx : & mut task :: Context , buf : & mut [ u8 ] )
191
191
-> Poll <usize , Error >
192
192
{
193
- ( * * self ) . poll_read( buf , cx )
193
+ ( * * self ) . poll_read( cx , buf )
194
194
}
195
195
196
- fn poll_vectored_read( & mut self , vec : & mut [ & mut IoVec ] , cx : & mut task :: Context )
196
+ fn poll_vectored_read( & mut self , cx : & mut task :: Context , vec : & mut [ & mut IoVec ] )
197
197
-> Poll <usize , Error >
198
198
{
199
- ( * * self ) . poll_vectored_read( vec , cx )
199
+ ( * * self ) . poll_vectored_read( cx , vec )
200
200
}
201
201
}
202
202
}
@@ -217,7 +217,7 @@ if_std! {
217
217
Initializer :: nop( )
218
218
}
219
219
220
- fn poll_read( & mut self , buf : & mut [ u8 ] , _ : & mut task :: Context )
220
+ fn poll_read( & mut self , _ : & mut task :: Context , buf : & mut [ u8 ] )
221
221
-> Poll <usize , Error >
222
222
{
223
223
Ok ( Async :: Ready ( StdIo :: Read :: read( self , buf) ?) )
@@ -239,16 +239,16 @@ if_std! {
239
239
240
240
macro_rules! deref_async_write {
241
241
( ) => {
242
- fn poll_write( & mut self , buf : & [ u8 ] , cx: & mut task:: Context )
242
+ fn poll_write( & mut self , cx: & mut task:: Context , buf : & [ u8 ] )
243
243
-> Poll <usize , Error >
244
244
{
245
- ( * * self ) . poll_write( buf , cx )
245
+ ( * * self ) . poll_write( cx , buf )
246
246
}
247
247
248
- fn poll_vectored_write( & mut self , vec : & [ & IoVec ] , cx: & mut task:: Context )
248
+ fn poll_vectored_write( & mut self , cx: & mut task:: Context , vec : & [ & IoVec ] )
249
249
-> Poll <usize , Error >
250
250
{
251
- ( * * self ) . poll_vectored_write( vec , cx )
251
+ ( * * self ) . poll_vectored_write( cx , vec )
252
252
}
253
253
254
254
fn poll_flush( & mut self , cx: & mut task:: Context ) -> Poll <( ) , Error > {
@@ -271,7 +271,7 @@ if_std! {
271
271
272
272
macro_rules! delegate_async_write_to_stdio {
273
273
( ) => {
274
- fn poll_write( & mut self , buf : & [ u8 ] , _: & mut task:: Context )
274
+ fn poll_write( & mut self , _: & mut task:: Context , buf : & [ u8 ] )
275
275
-> Poll <usize , Error >
276
276
{
277
277
Ok ( Async :: Ready ( StdIo :: Write :: write( self , buf) ?) )
0 commit comments