File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
library/std/src/io/buffered Expand file tree Collapse file tree 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> {
303303 let prev = cursor. written ( ) ;
304304
305305 let mut rem = self . fill_buf ( ) ?;
306- rem. read_buf ( cursor. reborrow ( ) ) ?;
306+ rem. read_buf ( cursor. reborrow ( ) ) ?; // actually never fails
307307
308308 self . consume ( cursor. written ( ) - prev) ; //slice impl of read_buf known to never unfill buf
309309
Original file line number Diff line number Diff line change @@ -111,11 +111,13 @@ impl Buffer {
111111 buf. set_init ( self . initialized ) ;
112112 }
113113
114- reader. read_buf ( buf. unfilled ( ) ) ? ;
114+ let result = reader. read_buf ( buf. unfilled ( ) ) ;
115115
116116 self . pos = 0 ;
117117 self . filled = buf. len ( ) ;
118118 self . initialized = buf. init_len ( ) ;
119+
120+ result?;
119121 }
120122 Ok ( self . buffer ( ) )
121123 }
You can’t perform that action at this time.
0 commit comments