about summary refs log tree commit diff
path: root/library/std/src/fs.rs
diff options
context:
space:
mode:
authorThalia Archibald <thalia@archibald.dev>2025-02-16 22:11:46 -0800
committerThalia Archibald <thalia@archibald.dev>2025-02-17 05:25:14 -0800
commit711247413465fc015420574d6afe929186ab0bb4 (patch)
tree36e10df2fa513ef3ac72c391d0458dad08131af8 /library/std/src/fs.rs
parentd5eb31c9347ae3c494c8d723711dacca7d1cfe8b (diff)
downloadrust-711247413465fc015420574d6afe929186ab0bb4.tar.gz
rust-711247413465fc015420574d6afe929186ab0bb4.zip
Use tell for <File as Seek>::stream_position
Diffstat (limited to 'library/std/src/fs.rs')
-rw-r--r--library/std/src/fs.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs
index 83b009c86dc..6001a2e2f39 100644
--- a/library/std/src/fs.rs
+++ b/library/std/src/fs.rs
@@ -1229,6 +1229,9 @@ impl Seek for &File {
     fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
         self.inner.seek(pos)
     }
+    fn stream_position(&mut self) -> io::Result<u64> {
+        self.inner.tell()
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -1275,6 +1278,9 @@ impl Seek for File {
     fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
         (&*self).seek(pos)
     }
+    fn stream_position(&mut self) -> io::Result<u64> {
+        (&*self).stream_position()
+    }
 }
 
 #[stable(feature = "io_traits_arc", since = "1.73.0")]