File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ impl<R: ?Sized + Read> Read for BufReader<R> {
349349 let prev = cursor. written ( ) ;
350350
351351 let mut rem = self . fill_buf ( ) ?;
352- rem. read_buf ( cursor. reborrow ( ) ) ?;
352+ rem. read_buf ( cursor. reborrow ( ) ) ?; // actually never fails
353353
354354 self . consume ( cursor. written ( ) - prev) ; //slice impl of read_buf known to never unfill buf
355355
Original file line number Diff line number Diff line change @@ -133,11 +133,13 @@ impl Buffer {
133133 buf. set_init ( self . initialized ) ;
134134 }
135135
136- reader. read_buf ( buf. unfilled ( ) ) ? ;
136+ let result = reader. read_buf ( buf. unfilled ( ) ) ;
137137
138138 self . pos = 0 ;
139139 self . filled = buf. len ( ) ;
140140 self . initialized = buf. init_len ( ) ;
141+
142+ result?;
141143 }
142144 Ok ( self . buffer ( ) )
143145 }
You can’t perform that action at this time.
0 commit comments