Skip to content

Commit

Permalink
Stabilize Seek::stream_position & change feature of Seek::stream_len
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasKalbertodt committed Jan 24, 2021
1 parent 446cbc9 commit 8a18fb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion library/std/src/io/buffered/bufreader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ impl<R: Seek> Seek for BufReader<R> {
/// # Example
///
/// ```no_run
/// #![feature(seek_convenience)]
/// use std::{
/// io::{self, BufRead, BufReader, Seek},
/// fs::File,
Expand Down
7 changes: 3 additions & 4 deletions library/std/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ pub trait Seek {
/// # Example
///
/// ```no_run
/// #![feature(seek_convenience)]
/// #![feature(seek_stream_len)]
/// use std::{
/// io::{self, Seek},
/// fs::File,
Expand All @@ -1685,7 +1685,7 @@ pub trait Seek {
/// Ok(())
/// }
/// ```
#[unstable(feature = "seek_convenience", issue = "59359")]
#[unstable(feature = "seek_stream_len", issue = "59359")]
fn stream_len(&mut self) -> Result<u64> {
let old_pos = self.stream_position()?;
let len = self.seek(SeekFrom::End(0))?;
Expand All @@ -1706,7 +1706,6 @@ pub trait Seek {
/// # Example
///
/// ```no_run
/// #![feature(seek_convenience)]
/// use std::{
/// io::{self, BufRead, BufReader, Seek},
/// fs::File,
Expand All @@ -1723,7 +1722,7 @@ pub trait Seek {
/// Ok(())
/// }
/// ```
#[unstable(feature = "seek_convenience", issue = "59359")]
#[stable(feature = "seek_convenience", since = "1.51.0")]
fn stream_position(&mut self) -> Result<u64> {
self.seek(SeekFrom::Current(0))
}
Expand Down

0 comments on commit 8a18fb0

Please sign in to comment.