We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 501293f + 97ec5f8 commit 9f2c8baCopy full SHA for 9f2c8ba
std/src/path.rs
@@ -2253,6 +2253,8 @@ impl Path {
2253
///
2254
/// let path = Path::new("foo.tar.gz");
2255
/// assert_eq!(path.with_extension(""), PathBuf::from("foo.tar"));
2256
+ /// assert_eq!(path.with_extension("xz"), PathBuf::from("foo.tar.xz"));
2257
+ /// assert_eq!(path.with_extension("").with_extension("txt"), PathBuf::from("foo.txt"));
2258
/// ```
2259
#[stable(feature = "rust1", since = "1.0.0")]
2260
pub fn with_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf {
0 commit comments