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.
1 parent d19d7e2 commit 9532b83Copy full SHA for 9532b83
library/std/src/path.rs
@@ -2247,6 +2247,8 @@ impl Path {
2247
///
2248
/// let path = Path::new("foo.tar.gz");
2249
/// assert_eq!(path.with_extension(""), PathBuf::from("foo.tar"));
2250
+ /// assert_eq!(path.with_extension("xz"), PathBuf::from("foo.tar.xz"));
2251
+ /// assert_eq!(path.with_extension("").with_extension("txt"), PathBuf::from("foo.txt"));
2252
/// ```
2253
#[stable(feature = "rust1", since = "1.0.0")]
2254
pub fn with_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf {
0 commit comments