Rollup merge of #131267 - okaneco:bufread_skip_until, r=tgross35

Stabilize `BufRead::skip_until`

FCP completed https://github.com/rust-lang/rust/issues/111735#issuecomment-2393893069

Closes #111735
This commit is contained in:
Jubilee 2024-10-04 19:19:26 -07:00 committed by GitHub
commit 3078b23bbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2382,8 +2382,6 @@ fn read_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize> {
/// about Ferris from a binary string, skipping the fun fact: /// about Ferris from a binary string, skipping the fun fact:
/// ///
/// ``` /// ```
/// #![feature(bufread_skip_until)]
///
/// use std::io::{self, BufRead}; /// use std::io::{self, BufRead};
/// ///
/// let mut cursor = io::Cursor::new(b"Ferris\0Likes long walks on the beach\0Crustacean\0"); /// let mut cursor = io::Cursor::new(b"Ferris\0Likes long walks on the beach\0Crustacean\0");
@ -2407,7 +2405,7 @@ fn read_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize> {
/// assert_eq!(num_bytes, 11); /// assert_eq!(num_bytes, 11);
/// assert_eq!(animal, b"Crustacean\0"); /// assert_eq!(animal, b"Crustacean\0");
/// ``` /// ```
#[unstable(feature = "bufread_skip_until", issue = "111735")] #[stable(feature = "bufread_skip_until", since = "CURRENT_RUSTC_VERSION")]
fn skip_until(&mut self, byte: u8) -> Result<usize> { fn skip_until(&mut self, byte: u8) -> Result<usize> {
skip_until(self, byte) skip_until(self, byte)
} }