mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
std: Refactor flush method in BufWriter to use the ? operator
This commit is contained in:
@@ -641,7 +641,8 @@ fn is_write_vectored(&self) -> bool {
|
||||
}
|
||||
|
||||
fn flush(&mut self) -> io::Result<()> {
|
||||
self.flush_buf().and_then(|()| self.get_mut().flush())
|
||||
self.flush_buf()?;
|
||||
self.get_mut().flush()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user