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 @@ -366,7 +366,6 @@ where
366
366
{
367
367
let start_len = buf. len ( ) ;
368
368
let mut g = Guard { len : buf. len ( ) , buf } ;
369
- let ret;
370
369
loop {
371
370
if g. len == g. buf . len ( ) {
372
371
unsafe {
@@ -386,10 +385,7 @@ where
386
385
}
387
386
388
387
match r. read ( & mut g. buf [ g. len ..] ) {
389
- Ok ( 0 ) => {
390
- ret = Ok ( g. len - start_len) ;
391
- break ;
392
- }
388
+ Ok ( 0 ) => return Ok ( g. len - start_len) ,
393
389
Ok ( n) => {
394
390
// We can't let g.len overflow which would result in the vec shrinking when the function returns. In
395
391
// particular, that could break read_to_string if the shortened buffer doesn't end on a UTF-8 boundary.
@@ -399,14 +395,9 @@ where
399
395
g. len += n;
400
396
}
401
397
Err ( ref e) if e. kind ( ) == ErrorKind :: Interrupted => { }
402
- Err ( e) => {
403
- ret = Err ( e) ;
404
- break ;
405
- }
398
+ Err ( e) => return Err ( e) ,
406
399
}
407
400
}
408
-
409
- ret
410
401
}
411
402
412
403
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