File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,6 @@ where
367
367
{
368
368
let start_len = buf. len ( ) ;
369
369
let mut g = Guard { len : buf. len ( ) , buf } ;
370
- let ret;
371
370
loop {
372
371
if g. len == g. buf . len ( ) {
373
372
unsafe {
@@ -387,10 +386,7 @@ where
387
386
}
388
387
389
388
match r. read ( & mut g. buf [ g. len ..] ) {
390
- Ok ( 0 ) => {
391
- ret = Ok ( g. len - start_len) ;
392
- break ;
393
- }
389
+ Ok ( 0 ) => return Ok ( g. len - start_len) ,
394
390
Ok ( n) => {
395
391
// We can't let g.len overflow which would result in the vec shrinking when the function returns. In
396
392
// particular, that could break read_to_string if the shortened buffer doesn't end on a UTF-8 boundary.
@@ -400,14 +396,9 @@ where
400
396
g. len += n;
401
397
}
402
398
Err ( ref e) if e. kind ( ) == ErrorKind :: Interrupted => { }
403
- Err ( e) => {
404
- ret = Err ( e) ;
405
- break ;
406
- }
399
+ Err ( e) => return Err ( e) ,
407
400
}
408
401
}
409
-
410
- ret
411
402
}
412
403
413
404
pub ( crate ) fn default_read_vectored < F > ( read : F , bufs : & mut [ IoSliceMut < ' _ > ] ) -> Result < usize >
You can’t perform that action at this time.
0 commit comments