diff options
| author | Hanna Kruppe <hanna.kruppe@gmail.com> | 2025-08-10 11:21:43 +0200 |
|---|---|---|
| committer | hanna <hanna.kruppe@gmail.com> | 2025-08-13 19:03:13 +0200 |
| commit | 52063ae24860bb5cb3abc6f3dd83904bc18a3b0f (patch) | |
| tree | ca44c8c4f025f58ad81035f5a84fa9c3cf206fc1 | |
| parent | 350d0ef0ec0493e6d21cfb265cb8211a0e74d766 (diff) | |
| download | rust-52063ae24860bb5cb3abc6f3dd83904bc18a3b0f.tar.gz rust-52063ae24860bb5cb3abc6f3dd83904bc18a3b0f.zip | |
stabilize path_add_extension
| -rw-r--r-- | library/std/src/path.rs | 8 | ||||
| -rw-r--r-- | library/std/tests/path.rs | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 3b52804d6be..2af6249f3b9 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -1575,8 +1575,6 @@ impl PathBuf { /// # Examples /// /// ``` - /// #![feature(path_add_extension)] - /// /// use std::path::{Path, PathBuf}; /// /// let mut p = PathBuf::from("/feel/the"); @@ -1596,7 +1594,7 @@ impl PathBuf { /// p.add_extension(""); /// assert_eq!(Path::new("/feel/the.formatted.dark"), p.as_path()); /// ``` - #[unstable(feature = "path_add_extension", issue = "127292")] + #[stable(feature = "path_add_extension", since = "CURRENT_RUSTC_VERSION")] pub fn add_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> bool { self._add_extension(extension.as_ref()) } @@ -2846,8 +2844,6 @@ impl Path { /// # Examples /// /// ``` - /// #![feature(path_add_extension)] - /// /// use std::path::{Path, PathBuf}; /// /// let path = Path::new("foo.rs"); @@ -2858,7 +2854,7 @@ impl Path { /// assert_eq!(path.with_added_extension("xz"), PathBuf::from("foo.tar.gz.xz")); /// assert_eq!(path.with_added_extension("").with_added_extension("txt"), PathBuf::from("foo.tar.gz.txt")); /// ``` - #[unstable(feature = "path_add_extension", issue = "127292")] + #[stable(feature = "path_add_extension", since = "CURRENT_RUSTC_VERSION")] pub fn with_added_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf { let mut new_path = self.to_path_buf(); new_path.add_extension(extension); diff --git a/library/std/tests/path.rs b/library/std/tests/path.rs index e1576a0d423..3577f0d9c7b 100644 --- a/library/std/tests/path.rs +++ b/library/std/tests/path.rs @@ -1,4 +1,4 @@ -#![feature(clone_to_uninit, path_add_extension, maybe_uninit_slice, normalize_lexically)] +#![feature(clone_to_uninit, maybe_uninit_slice, normalize_lexically)] use std::clone::CloneToUninit; use std::ffi::OsStr; |
