Rollup merge of #75287 - pickfire:patch-10, r=jonas-schievink
Show Path extension example change multi extension
This commit is contained in:
commit
42e163bf40
@ -2253,6 +2253,8 @@ impl Path {
|
||||
///
|
||||
/// let path = Path::new("foo.tar.gz");
|
||||
/// assert_eq!(path.with_extension(""), PathBuf::from("foo.tar"));
|
||||
/// assert_eq!(path.with_extension("xz"), PathBuf::from("foo.tar.xz"));
|
||||
/// assert_eq!(path.with_extension("").with_extension("txt"), PathBuf::from("foo.txt"));
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn with_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf {
|
||||
|
Loading…
Reference in New Issue
Block a user