Skip to content

Commit

Permalink
Rollup merge of #86121 - nickshiling:forwarding_impl_for_seek_trait_s…
Browse files Browse the repository at this point in the history
…tream_position, r=dtolnay

Forwarding implementation for Seek trait's stream_position method

Forwarding implementations for `Seek` trait's `stream_position` were missed when it was stabilized in `1.51.0`
  • Loading branch information
JohnTitor committed Jun 9, 2021
2 parents da1a449 + ed8a775 commit c961a0f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions library/std/src/io/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ impl<S: Seek + ?Sized> Seek for &mut S {
fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
(**self).seek(pos)
}

#[inline]
fn stream_position(&mut self) -> io::Result<u64> {
(**self).stream_position()
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<B: BufRead + ?Sized> BufRead for &mut B {
Expand Down Expand Up @@ -186,6 +191,11 @@ impl<S: Seek + ?Sized> Seek for Box<S> {
fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
(**self).seek(pos)
}

#[inline]
fn stream_position(&mut self) -> io::Result<u64> {
(**self).stream_position()
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<B: BufRead + ?Sized> BufRead for Box<B> {
Expand Down

0 comments on commit c961a0f

Please sign in to comment.