Skip to content

Commit

Permalink
Rollup merge of #72924 - JohnTitor:stabilize-buf-capacity, r=shepmaster
Browse files Browse the repository at this point in the history
Stabilize `std::io::Buf{Reader, Writer}::capacity`

Closes #68833
FCP is done here: #68833 (comment)
  • Loading branch information
Dylan-DPC authored Jun 3, 2020
2 parents 7973d93 + 7d27c63 commit ec2826c
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 @@ -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")]
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

0 comments on commit ec2826c

Please sign in to comment.