From 4d6810844e1b7a10af1da44d3217a66005866234 Mon Sep 17 00:00:00 2001
From: Nicholas Nethercote <n.nethercote@gmail.com>
Date: Thu, 12 Oct 2023 10:49:32 +1100
Subject: [PATCH] Inline `Bytes::next` and `Bytes::size_hint`.

This greatly increases its speed.
---
 library/std/src/io/mod.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs
index e6431abcf82..c0a72948112 100644
--- a/library/std/src/io/mod.rs
+++ b/library/std/src/io/mod.rs
@@ -2777,6 +2777,7 @@ pub struct Bytes<R> {
 impl<R: Read> Iterator for Bytes<R> {
     type Item = Result<u8>;
 
+    #[inline]
     fn next(&mut self) -> Option<Result<u8>> {
         let mut byte = 0;
         loop {
@@ -2789,6 +2790,7 @@ impl<R: Read> Iterator for Bytes<R> {
         }
     }
 
+    #[inline]
     fn size_hint(&self) -> (usize, Option<usize>) {
         SizeHint::size_hint(&self.inner)
     }