Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline trivial (noop) flush calls #114194

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ impl Write for &File {
self.inner.is_write_vectored()
}

#[inline]
fn flush(&mut self) -> io::Result<()> {
self.inner.flush()
}
Expand Down Expand Up @@ -836,6 +837,7 @@ impl Write for File {
fn is_write_vectored(&self) -> bool {
(&&*self).is_write_vectored()
}
#[inline]
fn flush(&mut self) -> io::Result<()> {
(&*self).flush()
}
Expand Down Expand Up @@ -881,6 +883,7 @@ impl Write for Arc<File> {
fn is_write_vectored(&self) -> bool {
(&**self).is_write_vectored()
}
#[inline]
fn flush(&mut self) -> io::Result<()> {
(&**self).flush()
}
Expand Down
1 change: 1 addition & 0 deletions library/std/src/io/readbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ impl<'a> Write for BorrowedCursor<'a> {
Ok(buf.len())
}

#[inline]
fn flush(&mut self) -> Result<()> {
Ok(())
}
Expand Down
2 changes: 2 additions & 0 deletions library/std/src/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ impl Write for TcpStream {
self.0.is_write_vectored()
}

#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
Expand Down Expand Up @@ -685,6 +686,7 @@ impl Write for &TcpStream {
self.0.is_write_vectored()
}

#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
Expand Down
1 change: 1 addition & 0 deletions library/std/src/os/unix/net/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ impl<'a> io::Write for &'a UnixStream {
self.0.is_write_vectored()
}

#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
Expand Down
2 changes: 2 additions & 0 deletions library/std/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ impl Write for ChildStdin {
io::Write::is_write_vectored(&&*self)
}

#[inline]
fn flush(&mut self) -> io::Result<()> {
(&*self).flush()
}
Expand All @@ -299,6 +300,7 @@ impl Write for &ChildStdin {
self.inner.is_write_vectored()
}

#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
Expand Down
1 change: 1 addition & 0 deletions library/std/src/sys/hermit/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ impl File {
false
}

#[inline]
pub fn flush(&self) -> io::Result<()> {
Ok(())
}
Expand Down
1 change: 1 addition & 0 deletions library/std/src/sys/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,7 @@ impl File {
self.0.write_vectored_at(bufs, offset)
}

#[inline]
pub fn flush(&self) -> io::Result<()> {
Ok(())
}
Expand Down
2 changes: 2 additions & 0 deletions library/std/src/sys/unix/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ impl io::Write for Stdout {
true
}

#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
Expand Down Expand Up @@ -81,6 +82,7 @@ impl io::Write for Stderr {
true
}

#[inline]
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
Expand Down