diff options
| author | Thalia Archibald <thalia@archibald.dev> | 2025-02-15 01:56:52 -0800 |
|---|---|---|
| committer | Thalia Archibald <thalia@archibald.dev> | 2025-02-27 17:07:20 -0800 |
| commit | 67cc82a704a38fcd574b0dc4373d939effed9496 (patch) | |
| tree | 17f0c903ec91a203b14e687eff6f8a6e4ce420c3 /library/std/src | |
| parent | f45d4acf1bb635aa010f19f8a749eed8293203b3 (diff) | |
| download | rust-67cc82a704a38fcd574b0dc4373d939effed9496.tar.gz rust-67cc82a704a38fcd574b0dc4373d939effed9496.zip | |
Inline VecDeque<u8> and BorrowedCursor methods
All other methods in this file have #[inline] and these methods are very similar to those of &[u8] which are already inlined here.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/io/impls.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/io/impls.rs b/library/std/src/io/impls.rs index 8239b29884e..7885332cfde 100644 --- a/library/std/src/io/impls.rs +++ b/library/std/src/io/impls.rs @@ -515,6 +515,7 @@ impl<A: Allocator> Read for VecDeque<u8, A> { Ok(n) } + #[inline] fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> { let (front, back) = self.as_slices(); @@ -547,6 +548,7 @@ impl<A: Allocator> Read for VecDeque<u8, A> { Ok(()) } + #[inline] fn read_buf_exact(&mut self, mut cursor: BorrowedCursor<'_>) -> io::Result<()> { let len = cursor.capacity(); let (front, back) = self.as_slices(); @@ -646,6 +648,7 @@ impl<A: Allocator> Write for VecDeque<u8, A> { #[unstable(feature = "read_buf", issue = "78485")] impl<'a> io::Write for core::io::BorrowedCursor<'a> { + #[inline] fn write(&mut self, buf: &[u8]) -> io::Result<usize> { let amt = cmp::min(buf.len(), self.capacity()); self.append(&buf[..amt]); |
