From d8f8adfe3df3cdc882db8ba7dfb9d7fcc8533b82 Mon Sep 17 00:00:00 2001 From: Valdemar Erk Date: Fri, 20 Jan 2023 12:03:43 +0100 Subject: [PATCH] add example of joining with a absolute path --- library/std/src/path.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 500a09ad08a..2f53cf83936 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -2541,6 +2541,7 @@ impl Path { /// use std::path::{Path, PathBuf}; /// /// assert_eq!(Path::new("/etc").join("passwd"), PathBuf::from("/etc/passwd")); + /// assert_eq!(Path::new("/etc").join("/bin/sh"), PathBuf::from("/bin/sh")); /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[must_use]