X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibstd%2Ffs.rs;h=e40a3d06f77537201336b442ee78d6dc47bc05d6;hb=4043c0247ebf5139f52a92b1501e4cdcbd5f1bd7;hp=414a0ebd11fa27ce0cc8c4b79f68b45a252229cc;hpb=51108b64ca3c84d9973736e6b9e094e79c12dc60;p=rust.git diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 414a0ebd11f..e40a3d06f77 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -414,7 +414,7 @@ pub fn read(&mut self, read: bool) -> &mut OpenOptions { /// This option, when true, will indicate that the file should be /// `write`-able if opened. /// - /// If a file already exist, any write calls on the file will overwrite its + /// If the file already exists, any write calls on it will overwrite its /// contents, without truncating it. /// /// # Examples @@ -436,19 +436,19 @@ pub fn write(&mut self, write: bool) -> &mut OpenOptions { /// Note that setting `.write(true).append(true)` has the same effect as /// setting only `.append(true)`. /// - /// For most filesystems the operating system guarantees all writes are + /// For most filesystems, the operating system guarantees that all writes are /// atomic: no writes get mangled because another process writes at the same /// time. /// /// One maybe obvious note when using append-mode: make sure that all data - /// that belongs together, is written the the file in one operation. This + /// that belongs together is written to the file in one operation. This /// can be done by concatenating strings before passing them to `write()`, - /// or using a buffered writer (with a more than adequately sized buffer) + /// or using a buffered writer (with a buffer of adequate size), /// and calling `flush()` when the message is complete. /// /// If a file is opened with both read and append access, beware that after - /// opening and after every write the position for reading may be set at the - /// end of the file. So before writing save the current position (using + /// opening, and after every write, the position for reading may be set at the + /// end of the file. So, before writing, save the current position (using /// `seek(SeekFrom::Current(0))`, and restore it before the next read. /// /// # Examples @@ -487,8 +487,8 @@ pub fn truncate(&mut self, truncate: bool) -> &mut OpenOptions { /// This option indicates whether a new file will be created if the file /// does not yet already exist. /// - /// The file must be opened with write or append access in order to create - /// a new file. + /// In order for the file to be created, `write` or `append` access must + /// be used. /// /// # Examples ///