Skip to content

Commit

Permalink
Rollup merge of rust-lang#61235 - lzutao:stabilize-bufreader_buffer, …
Browse files Browse the repository at this point in the history
…r=Centril

Stabilize bufreader_buffer feature

FCP done in rust-lang#45323 (comment)

Closes rust-lang#45323

r? @SimonSapin
  • Loading branch information
Centril authored May 29, 2019
2 parents 01c3ca1 + 06eb412 commit 405edc7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/libstd/io/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ impl<R> BufReader<R> {
/// # Examples
///
/// ```no_run
/// # #![feature(bufreader_buffer)]
/// use std::io::{BufReader, BufRead};
/// use std::fs::File;
///
Expand All @@ -173,7 +172,7 @@ impl<R> BufReader<R> {
/// Ok(())
/// }
/// ```
#[unstable(feature = "bufreader_buffer", issue = "45323")]
#[stable(feature = "bufreader_buffer", since = "1.37.0")]
pub fn buffer(&self) -> &[u8] {
&self.buf[self.pos..self.cap]
}
Expand Down Expand Up @@ -552,7 +551,6 @@ impl<W: Write> BufWriter<W> {
/// # Examples
///
/// ```no_run
/// # #![feature(bufreader_buffer)]
/// use std::io::BufWriter;
/// use std::net::TcpStream;
///
Expand All @@ -561,7 +559,7 @@ impl<W: Write> BufWriter<W> {
/// // See how many bytes are currently buffered
/// let bytes_buffered = buf_writer.buffer().len();
/// ```
#[unstable(feature = "bufreader_buffer", issue = "45323")]
#[stable(feature = "bufreader_buffer", since = "1.37.0")]
pub fn buffer(&self) -> &[u8] {
&self.buf
}
Expand Down

0 comments on commit 405edc7

Please sign in to comment.