diff options
| author | myshylin <myshylin@microsoft.com> | 2021-06-07 19:21:22 -0400 |
|---|---|---|
| committer | myshylin <myshylin@microsoft.com> | 2021-06-07 19:21:22 -0400 |
| commit | ed8a775b7146722954ed4a67ec859887b8befc34 (patch) | |
| tree | 3279d3d21f14e78194d77c0145743278469171b0 /library/std/src/io/impls.rs | |
| parent | e4a60327063e82413eed50a10df3b7d19b77bda0 (diff) | |
| download | rust-ed8a775b7146722954ed4a67ec859887b8befc34.tar.gz rust-ed8a775b7146722954ed4a67ec859887b8befc34.zip | |
Forwarding implementation for Seek trait's stream_position method
Diffstat (limited to 'library/std/src/io/impls.rs')
| -rw-r--r-- | library/std/src/io/impls.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/library/std/src/io/impls.rs b/library/std/src/io/impls.rs index 6891bd8a664..7a2a49ba7d7 100644 --- a/library/std/src/io/impls.rs +++ b/library/std/src/io/impls.rs @@ -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 { @@ -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> { |
