Skip to content

Commit 67cc82a

Browse files
committed
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.
1 parent f45d4ac commit 67cc82a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/std/src/io/impls.rs

+3
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ impl<A: Allocator> Read for VecDeque<u8, A> {
515515
Ok(n)
516516
}
517517

518+
#[inline]
518519
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
519520
let (front, back) = self.as_slices();
520521

@@ -547,6 +548,7 @@ impl<A: Allocator> Read for VecDeque<u8, A> {
547548
Ok(())
548549
}
549550

551+
#[inline]
550552
fn read_buf_exact(&mut self, mut cursor: BorrowedCursor<'_>) -> io::Result<()> {
551553
let len = cursor.capacity();
552554
let (front, back) = self.as_slices();
@@ -646,6 +648,7 @@ impl<A: Allocator> Write for VecDeque<u8, A> {
646648

647649
#[unstable(feature = "read_buf", issue = "78485")]
648650
impl<'a> io::Write for core::io::BorrowedCursor<'a> {
651+
#[inline]
649652
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
650653
let amt = cmp::min(buf.len(), self.capacity());
651654
self.append(&buf[..amt]);

0 commit comments

Comments
 (0)