Skip to content

Commit 7d7b202

Browse files
committed
stabilize path_add_extension
1 parent 915a766 commit 7d7b202

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

library/std/src/path.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,8 +1575,6 @@ impl PathBuf {
15751575
/// # Examples
15761576
///
15771577
/// ```
1578-
/// #![feature(path_add_extension)]
1579-
///
15801578
/// use std::path::{Path, PathBuf};
15811579
///
15821580
/// let mut p = PathBuf::from("/feel/the");
@@ -1596,7 +1594,7 @@ impl PathBuf {
15961594
/// p.add_extension("");
15971595
/// assert_eq!(Path::new("/feel/the.formatted.dark"), p.as_path());
15981596
/// ```
1599-
#[unstable(feature = "path_add_extension", issue = "127292")]
1597+
#[stable(feature = "path_add_extension", since = "CURRENT_RUSTC_VERSION")]
16001598
pub fn add_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> bool {
16011599
self._add_extension(extension.as_ref())
16021600
}
@@ -2847,8 +2845,6 @@ impl Path {
28472845
/// # Examples
28482846
///
28492847
/// ```
2850-
/// #![feature(path_add_extension)]
2851-
///
28522848
/// use std::path::{Path, PathBuf};
28532849
///
28542850
/// let path = Path::new("foo.rs");
@@ -2859,7 +2855,7 @@ impl Path {
28592855
/// assert_eq!(path.with_added_extension("xz"), PathBuf::from("foo.tar.gz.xz"));
28602856
/// assert_eq!(path.with_added_extension("").with_added_extension("txt"), PathBuf::from("foo.tar.gz.txt"));
28612857
/// ```
2862-
#[unstable(feature = "path_add_extension", issue = "127292")]
2858+
#[stable(feature = "path_add_extension", since = "CURRENT_RUSTC_VERSION")]
28632859
pub fn with_added_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf {
28642860
let mut new_path = self.to_path_buf();
28652861
new_path.add_extension(extension);

library/std/tests/path.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
#![feature(
2-
clone_to_uninit,
3-
path_add_extension,
4-
path_file_prefix,
5-
maybe_uninit_slice,
6-
normalize_lexically
7-
)]
1+
#![feature(clone_to_uninit, path_file_prefix, maybe_uninit_slice, normalize_lexically)]
82

93
use std::clone::CloneToUninit;
104
use std::ffi::OsStr;

0 commit comments

Comments
 (0)