mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
Rollup merge of #155741 - xtqqczze:question-mark-bufwriter-flush, r=WaffleLapkin
std: Refactor BufWriter::flush to use the `?` operator Functionally, this is equivalent and may be slightly more amenable to inlining.
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