We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
io::BufReader
read_buf
1 parent 8472204 commit 57f279dCopy full SHA for 57f279d
std/src/io/buffered/bufreader.rs
@@ -349,7 +349,7 @@ impl<R: ?Sized + Read> Read for BufReader<R> {
349
let prev = cursor.written();
350
351
let mut rem = self.fill_buf()?;
352
- rem.read_buf(cursor.reborrow())?;
+ rem.read_buf(cursor.reborrow())?; // actually never fails
353
354
self.consume(cursor.written() - prev); //slice impl of read_buf known to never unfill buf
355
std/src/io/buffered/bufreader/buffer.rs
@@ -133,11 +133,13 @@ impl Buffer {
133
buf.set_init(self.initialized);
134
}
135
136
- reader.read_buf(buf.unfilled())?;
+ let result = reader.read_buf(buf.unfilled());
137
138
self.pos = 0;
139
self.filled = buf.len();
140
self.initialized = buf.init_len();
141
+
142
+ result?;
143
144
Ok(self.buffer())
145
0 commit comments