Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,18 @@ impl File {
/// will be extended to `size` and have all of the intermediate data filled
/// in with 0s.
///
/// # Errors
///
/// This function will return an error if the file is not opened for writing.
///
/// # Examples
///
/// ```no_run
/// use std::fs::File;
///
/// # fn foo() -> std::io::Result<()> {
/// let mut f = try!(File::open("foo.txt"));
/// try!(f.set_len(0));
/// let mut f = try!(File::create("foo.txt"));
/// try!(f.set_len(10));
/// # Ok(())
/// # }
/// ```
Expand Down