1
Fork 0

Add note to documentation

This commit is contained in:
Diggory Blake 2018-01-13 18:44:25 +00:00
parent 562ba04e45
commit c96f30257a

View file

@ -285,6 +285,8 @@ impl<R: Seek> Seek for BufReader<R> {
/// `.into_inner()` immediately after a seek yields the underlying reader
/// at the same position.
///
/// To seek without discarding the internal buffer, use [`seek_relative`].
///
/// See `std::io::Seek` for more details.
///
/// Note: In the edge case where you're seeking with `SeekFrom::Current(n)`
@ -292,6 +294,8 @@ impl<R: Seek> Seek for BufReader<R> {
/// seeks will be performed instead of one. If the second seek returns
/// `Err`, the underlying reader will be left at the same position it would
/// have if you seeked to `SeekFrom::Current(0)`.
///
/// [`seek_relative`]: #method.seek_relative
fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
let result: u64;
if let SeekFrom::Current(n) = pos {