Fix minor documentation issue. Code outside the test would fail. Seek documentation clearly states that negative indexes will cause error.
Just making the code in the example to return Result::Ok, instead of Result::Error.
This commit is contained in:
parent
fe61575228
commit
07e0182fd3
@ -51,6 +51,8 @@ use crate::io::{self, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut, SeekFrom};
|
||||
/// // We might want to use a BufReader here for efficiency, but let's
|
||||
/// // keep this example focused.
|
||||
/// let mut file = File::create("foo.txt")?;
|
||||
/// // First, we need to allocate 10 bytes to be able to write into.
|
||||
/// file.set_len(10)?;
|
||||
///
|
||||
/// write_ten_bytes_at_end(&mut file)?;
|
||||
/// # Ok(())
|
||||
|
Loading…
x
Reference in New Issue
Block a user