Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize std::io::Buf{Reader, Writer}::capacity #72924

Merged
merged 1 commit into from
Jun 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/libstd/io/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ impl<R> BufReader<R> {
/// # Examples
///
/// ```no_run
/// #![feature(buffered_io_capacity)]
/// use std::io::{BufReader, BufRead};
/// use std::fs::File;
///
Expand All @@ -198,7 +197,7 @@ impl<R> BufReader<R> {
/// Ok(())
/// }
/// ```
#[unstable(feature = "buffered_io_capacity", issue = "68833")]
#[stable(feature = "buffered_io_capacity", since = "1.46.0")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set 1.46.0 here since promoting will happen soon.

pub fn capacity(&self) -> usize {
self.buf.len()
}
Expand Down Expand Up @@ -609,7 +608,6 @@ impl<W: Write> BufWriter<W> {
/// # Examples
///
/// ```no_run
/// #![feature(buffered_io_capacity)]
/// use std::io::BufWriter;
/// use std::net::TcpStream;
///
Expand All @@ -620,7 +618,7 @@ impl<W: Write> BufWriter<W> {
/// // Calculate how many bytes can be written without flushing
/// let without_flush = capacity - buf_writer.buffer().len();
/// ```
#[unstable(feature = "buffered_io_capacity", issue = "68833")]
#[stable(feature = "buffered_io_capacity", since = "1.46.0")]
pub fn capacity(&self) -> usize {
self.buf.capacity()
}
Expand Down