From f608b917f164b07cf707c279d8d7e6c99b79c5f6 Mon Sep 17 00:00:00 2001 From: Christopher Jefferson Date: Mon, 3 Jun 2024 14:34:20 +0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> --- library/std/src/path.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index a57dbbe3c0da1..bd8aed2fa5560 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -1169,7 +1169,6 @@ impl FusedIterator for Ancestors<'_> {} /// path.push(r"..\otherdir"); /// path.push("system32"); /// -/// path.set_extension(r"\..\temp"); #[cfg_attr(not(test), rustc_diagnostic_item = "PathBuf")] #[stable(feature = "rust1", since = "1.0.0")] pub struct PathBuf { @@ -1456,8 +1455,6 @@ impl PathBuf { /// If the file stem contains internal dots and `extension` is empty, part /// of the old file stem will be considered the new [`self.extension`]. /// - /// The new `extension` is not sanitized, so may include separators. - /// /// See the examples below. /// /// [`self.file_name`]: Path::file_name @@ -1487,9 +1484,6 @@ impl PathBuf { /// /// p.set_extension(""); /// assert_eq!(Path::new("/feel/the"), p.as_path()); - /// - /// p.set_extension("/darkest.cookie"); - /// assert_eq!(Path::new("/feel/the./darkest.cookie"), p.as_path()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn set_extension>(&mut self, extension: S) -> bool {