Skip to content

Commit 654c578

Browse files
committed
Rollup merge of rust-lang#53376 - frewsxcv:frewsxcv-copy, r=GuillaumeGomez
Cross reference io::copy and fs::copy in docs. Fixes rust-lang#52524.
2 parents 846a0bd + 5f198a5 commit 654c578

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/libstd/fs.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,12 @@ pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()>
15661566
/// On success, the total number of bytes copied is returned and it is equal to
15671567
/// the length of the `to` file as reported by `metadata`.
15681568
///
1569+
/// If you’re wanting to copy the contents of one file to another and you’re
1570+
/// working with [`File`]s, see the [`io::copy`] function.
1571+
///
1572+
/// [`io::copy`]: ../io/fn.copy.html
1573+
/// [`File`]: ./struct.File.html
1574+
///
15691575
/// # Platform-specific behavior
15701576
///
15711577
/// This function currently corresponds to the `open` function in Unix

src/libstd/io/util.rs

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ use mem;
2323
/// On success, the total number of bytes that were copied from
2424
/// `reader` to `writer` is returned.
2525
///
26+
/// If you’re wanting to copy the contents of one file to another and you’re
27+
/// working with filesystem paths, see the [`fs::copy`] function.
28+
///
29+
/// [`fs::copy`]: ../fs/fn.copy.html
30+
///
2631
/// # Errors
2732
///
2833
/// This function will return an error immediately if any call to `read` or

0 commit comments

Comments
 (0)