Skip to content

Commit c58d3bc

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 b3a0d9c commit c58d3bc

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
@@ -521,6 +521,7 @@ impl<A: Allocator> Read for VecDeque<u8, A> {
521521
Ok(n)
522522
}
523523

524+
#[inline]
524525
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
525526
let (front, back) = self.as_slices();
526527

@@ -553,6 +554,7 @@ impl<A: Allocator> Read for VecDeque<u8, A> {
553554
Ok(())
554555
}
555556

557+
#[inline]
556558
fn read_buf_exact(&mut self, mut cursor: BorrowedCursor<'_>) -> io::Result<()> {
557559
let len = cursor.capacity();
558560
let (front, back) = self.as_slices();
@@ -658,6 +660,7 @@ impl<A: Allocator> Write for VecDeque<u8, A> {
658660

659661
#[unstable(feature = "read_buf", issue = "78485")]
660662
impl<'a> io::Write for core::io::BorrowedCursor<'a> {
663+
#[inline]
661664
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
662665
let amt = cmp::min(buf.len(), self.capacity());
663666
self.append(&buf[..amt]);

0 commit comments

Comments
 (0)