From d9f7c9db02c023adfeba554971abbf11bb244994 Mon Sep 17 00:00:00 2001 From: Jonathan Behrens Date: Sat, 4 Nov 2023 15:45:55 -0700 Subject: [PATCH] Improve documentation --- library/std/src/io/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 9ee68a079bc..bd6a989ee96 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -1960,7 +1960,9 @@ pub trait Seek { /// Seeks relative to the current position. /// - /// This is equivalent to `self.seek(SeekFrom::Current(offset))`. + /// This is equivalent to `self.seek(SeekFrom::Current(offset))` but + /// doesn't return the new position which can allow some implementations + /// such as [`BufReader`] to perform more efficient seeks. /// /// # Example /// @@ -1978,6 +1980,8 @@ pub trait Seek { /// Ok(()) /// } /// ``` + /// + /// [`BufReader`]: crate::io::BufReader #[unstable(feature = "seek_seek_relative", issue = "117374")] fn seek_relative(&mut self, offset: i64) -> Result<()> { self.seek(SeekFrom::Current(offset))?;