File tree 2 files changed +4
-2
lines changed
library/std/src/io/buffered
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ impl<R: ?Sized + Read> Read for BufReader<R> {
303
303
let prev = cursor. written ( ) ;
304
304
305
305
let mut rem = self . fill_buf ( ) ?;
306
- rem. read_buf ( cursor. reborrow ( ) ) ?;
306
+ rem. read_buf ( cursor. reborrow ( ) ) ?; // actually never fails
307
307
308
308
self . consume ( cursor. written ( ) - prev) ; //slice impl of read_buf known to never unfill buf
309
309
Original file line number Diff line number Diff line change @@ -111,11 +111,13 @@ impl Buffer {
111
111
buf. set_init ( self . initialized ) ;
112
112
}
113
113
114
- reader. read_buf ( buf. unfilled ( ) ) ? ;
114
+ let result = reader. read_buf ( buf. unfilled ( ) ) ;
115
115
116
116
self . pos = 0 ;
117
117
self . filled = buf. len ( ) ;
118
118
self . initialized = buf. init_len ( ) ;
119
+
120
+ result?;
119
121
}
120
122
Ok ( self . buffer ( ) )
121
123
}
You can’t perform that action at this time.
0 commit comments