Rollup merge of #114194 - thomcc:flushinline, r=cuviper
Inline trivial (noop) flush calls At work I noticed that `writer.flush()?` didn't get optimized away in cases where the flush is obviously a no-op, which I had expected (well, desired). I went through and added `#[inline]` to a bunch of cases that were obviously noops, or delegated to ones that were obviously noops. I omitted platforms I don't have access to (some tier3). I didn't do this very scientifically, in cases where it was non-obvious I left `#[inline]` off.
This commit is contained in:
commit
0c241e6bdb
8 changed files with 13 additions and 0 deletions
|
|
@ -335,6 +335,7 @@ impl File {
|
|||
false
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn flush(&self) -> io::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1204,6 +1204,7 @@ impl File {
|
|||
self.0.write_vectored_at(bufs, offset)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn flush(&self) -> io::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ impl io::Write for Stdout {
|
|||
true
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn flush(&mut self) -> io::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -81,6 +82,7 @@ impl io::Write for Stderr {
|
|||
true
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn flush(&mut self) -> io::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue