stabilize path_add_extension · rust-lang/rust@52063ae (original) (raw)

`@@ -1575,8 +1575,6 @@ impl PathBuf {

`

1575

1575

`/// # Examples

`

1576

1576

`///

`

1577

1577

```` /// ```


`1578`

``

`-

/// #![feature(path_add_extension)]

`

`1579`

``

`-

///

`

`1580`

`1578`

`/// use std::path::{Path, PathBuf};

`

`1581`

`1579`

`///

`

`1582`

`1580`

`/// let mut p = PathBuf::from("/feel/the");

`

`@@ -1596,7 +1594,7 @@ impl PathBuf {

`

`1596`

`1594`

`/// p.add_extension("");

`

`1597`

`1595`

`/// assert_eq!(Path::new("/feel/the.formatted.dark"), p.as_path());

`

`1598`

`1596`

```` /// ```

1599

``

`-

#[unstable(feature = "path_add_extension", issue = "127292")]

`

``

1597

`+

#[stable(feature = "path_add_extension", since = "CURRENT_RUSTC_VERSION")]

`

1600

1598

`pub fn add_extension<S: AsRef>(&mut self, extension: S) -> bool {

`

1601

1599

`self._add_extension(extension.as_ref())

`

1602

1600

`}

`

`@@ -2846,8 +2844,6 @@ impl Path {

`

2846

2844

`/// # Examples

`

2847

2845

`///

`

2848

2846

```` /// ```


`2849`

``

`-

/// #![feature(path_add_extension)]

`

`2850`

``

`-

///

`

`2851`

`2847`

`/// use std::path::{Path, PathBuf};

`

`2852`

`2848`

`///

`

`2853`

`2849`

`/// let path = Path::new("foo.rs");

`

`@@ -2858,7 +2854,7 @@ impl Path {

`

`2858`

`2854`

`/// assert_eq!(path.with_added_extension("xz"), PathBuf::from("foo.tar.gz.xz"));

`

`2859`

`2855`

`/// assert_eq!(path.with_added_extension("").with_added_extension("txt"), PathBuf::from("foo.tar.gz.txt"));

`

`2860`

`2856`

```` /// ```

2861

``

`-

#[unstable(feature = "path_add_extension", issue = "127292")]

`

``

2857

`+

#[stable(feature = "path_add_extension", since = "CURRENT_RUSTC_VERSION")]

`

2862

2858

`pub fn with_added_extension<S: AsRef>(&self, extension: S) -> PathBuf {

`

2863

2859

`let mut new_path = self.to_path_buf();

`

2864

2860

` new_path.add_extension(extension);

`