Skip to content

Commit 5446139

Browse files
committed
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
2 parents 88e819f + 9a7e232 commit 5446139

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libstd/fs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ pub fn symlink_metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
842842
/// use std::fs;
843843
///
844844
/// # fn foo() -> std::io::Result<()> {
845-
/// try!(fs::rename("a.txt", "b.txt"));
845+
/// try!(fs::rename("a.txt", "b.txt")); // Rename a.txt to b.txt
846846
/// # Ok(())
847847
/// # }
848848
/// ```
@@ -877,7 +877,7 @@ pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()>
877877
/// use std::fs;
878878
///
879879
/// # fn foo() -> std::io::Result<()> {
880-
/// try!(fs::copy("foo.txt", "bar.txt"));
880+
/// try!(fs::copy("foo.txt", "bar.txt")); // Copy foo.txt to bar.txt
881881
/// # Ok(()) }
882882
/// ```
883883
#[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> {
896896
/// use std::fs;
897897
///
898898
/// # fn foo() -> std::io::Result<()> {
899-
/// try!(fs::hard_link("a.txt", "b.txt"));
899+
/// try!(fs::hard_link("a.txt", "b.txt")); // Hard link a.txt to b.txt
900900
/// # Ok(())
901901
/// # }
902902
/// ```

0 commit comments

Comments
 (0)