diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 7632fbc41f5a3..3e0da93d0e338 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -1566,6 +1566,12 @@ pub fn rename, Q: AsRef>(from: P, to: Q) -> io::Result<()> /// On success, the total number of bytes copied is returned and it is equal to /// the length of the `to` file as reported by `metadata`. /// +/// If you’re wanting to copy the contents of one file to another and you’re +/// working with [`File`]s, see the [`io::copy`] function. +/// +/// [`io::copy`]: ../io/fn.copy.html +/// [`File`]: ./struct.File.html +/// /// # Platform-specific behavior /// /// This function currently corresponds to the `open` function in Unix diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs index 33f741dbc38f2..371e5b21c13b2 100644 --- a/src/libstd/io/util.rs +++ b/src/libstd/io/util.rs @@ -23,6 +23,11 @@ use mem; /// On success, the total number of bytes that were copied from /// `reader` to `writer` is returned. /// +/// If you’re wanting to copy the contents of one file to another and you’re +/// working with filesystem paths, see the [`fs::copy`] function. +/// +/// [`fs::copy`]: ../fs/fn.copy.html +/// /// # Errors /// /// This function will return an error immediately if any call to `read` or