Auto merge of #30670 - emoon:fs-copy-comment, r=steveklabnik
When looking in the documentation I often scan the examples the first thing I do. In these 3 cases it's not obvious which direction the operation happens by adding this comment it makes it more obvious. r? @steveklabnik
This commit is contained in:
commit
5446139387
@ -842,7 +842,7 @@ pub fn symlink_metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
|
||||
/// use std::fs;
|
||||
///
|
||||
/// # fn foo() -> std::io::Result<()> {
|
||||
/// try!(fs::rename("a.txt", "b.txt"));
|
||||
/// try!(fs::rename("a.txt", "b.txt")); // Rename a.txt to b.txt
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// ```
|
||||
@ -877,7 +877,7 @@ pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()>
|
||||
/// use std::fs;
|
||||
///
|
||||
/// # fn foo() -> std::io::Result<()> {
|
||||
/// try!(fs::copy("foo.txt", "bar.txt"));
|
||||
/// try!(fs::copy("foo.txt", "bar.txt")); // Copy foo.txt to bar.txt
|
||||
/// # Ok(()) }
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
@ -896,7 +896,7 @@ pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<u64> {
|
||||
/// use std::fs;
|
||||
///
|
||||
/// # fn foo() -> std::io::Result<()> {
|
||||
/// try!(fs::hard_link("a.txt", "b.txt"));
|
||||
/// try!(fs::hard_link("a.txt", "b.txt")); // Hard link a.txt to b.txt
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// ```
|
||||
|
Loading…
Reference in New Issue
Block a user