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 f98c77c + 83094ea commit 5629223Copy full SHA for 5629223
src/libstd/path.rs
@@ -2244,6 +2244,9 @@ impl Path {
2244
///
2245
/// let path = Path::new("foo.rs");
2246
/// assert_eq!(path.with_extension("txt"), PathBuf::from("foo.txt"));
2247
+ ///
2248
+ /// let path = Path::new("foo.tar.gz");
2249
+ /// assert_eq!(path.with_extension(""), PathBuf::from("foo.tar"));
2250
/// ```
2251
#[stable(feature = "rust1", since = "1.0.0")]
2252
pub fn with_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf {
0 commit comments