From ab274630b9b0accb3b86ca70687240f92d488629 Mon Sep 17 00:00:00 2001 From: Harshit Verma <harshitverma933@gmail.com> Date: Mon, 13 Jan 2025 01:57:57 +0530 Subject: [PATCH] Add `File already exists` error doc to `hard_link` function If the link path already exists, the error `AlreadyExists` is returned. This commit adds this error to the docs. --- library/std/src/fs.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 9b752ed14437c..1f8aac48a9a8b 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -2529,6 +2529,7 @@ pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<u64> { /// limited to just these cases: /// /// * The `original` path is not a file or doesn't exist. +/// * The 'link' path already exists. /// /// # Examples ///