Skip to content

Commit 6c755a3

Browse files
committed
Optimize: Add #[inline] to very simple function
Signed-off-by: Jiahao XU <[email protected]>
1 parent d9f0980 commit 6c755a3

File tree

1 file changed

+4
-0
lines changed
  • library/std/src/sys/anonymous_pipe

1 file changed

+4
-0
lines changed

library/std/src/sys/anonymous_pipe/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ macro_rules! forward_io_read_traits {
5151
fn read_vectored(&mut self, bufs: &mut [io::IoSliceMut<'_>]) -> io::Result<usize> {
5252
self.0.read_vectored(bufs)
5353
}
54+
#[inline]
5455
fn is_read_vectored(&self) -> bool {
5556
self.0.is_read_vectored()
5657
}
@@ -73,13 +74,16 @@ macro_rules! forward_io_write_traits {
7374
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
7475
self.0.write(buf)
7576
}
77+
#[inline]
7678
fn flush(&mut self) -> io::Result<()> {
7779
Ok(())
7880
}
7981

8082
fn write_vectored(&mut self, bufs: &[io::IoSlice<'_>]) -> io::Result<usize> {
8183
self.0.write_vectored(bufs)
8284
}
85+
86+
#[inline]
8387
fn is_write_vectored(&self) -> bool {
8488
self.0.is_write_vectored()
8589
}

0 commit comments

Comments
 (0)