@@ -195,34 +195,33 @@ macro_rules! impl_buffered_source {
195
195
196
196
let start = buf. len( ) ;
197
197
loop {
198
- match self $( . $reader) ? . fill_buf( ) $( . $await) ? {
198
+ let available = match self $( . $reader) ? . fill_buf( ) $( . $await) ? {
199
199
Ok ( n) if n. is_empty( ) => break ,
200
- Ok ( available) => {
201
- if let Some ( used) = parser. feed( available) {
200
+ Ok ( n) => n,
201
+ Err ( ref e) if e. kind( ) == io:: ErrorKind :: Interrupted => continue ,
202
+ Err ( e) => {
203
+ * position += read;
204
+ return Err ( Error :: Io ( e. into( ) ) ) ;
205
+ }
206
+ } ;
207
+
208
+ if let Some ( used) = parser. feed( available) {
202
209
buf. extend_from_slice( & available[ ..used] ) ;
203
210
204
211
// +1 for `>` which we do not include
205
212
self $( . $reader) ? . consume( used + 1 ) ;
206
213
read += used + 1 ;
207
214
208
- // Position now just after the `>` symbol
209
- * position += read;
210
- return Ok ( & buf[ start..] ) ;
211
- } else {
212
- // The `>` symbol not yet found, continue reading
213
- buf. extend_from_slice( available) ;
215
+ // Position now just after the `>` symbol
216
+ * position += read;
217
+ return Ok ( & buf[ start..] ) ;
218
+ }
214
219
215
- let used = available. len( ) ;
216
- self $( . $reader) ? . consume( used) ;
217
- read += used;
218
- }
219
- }
220
- Err ( ref e) if e. kind( ) == io:: ErrorKind :: Interrupted => continue ,
221
- Err ( e) => {
222
- * position += read;
223
- return Err ( Error :: Io ( e. into( ) ) ) ;
224
- }
225
- } ;
220
+ // The `>` symbol not yet found, continue reading
221
+ buf. extend_from_slice( available) ;
222
+ let used = available. len( ) ;
223
+ self $( . $reader) ? . consume( used) ;
224
+ read += used;
226
225
}
227
226
228
227
* position += read;
0 commit comments