@@ -2739,30 +2739,30 @@ impl Path {
27392739 /// # Examples
27402740 ///
27412741 /// ```
2742- /// use std::path::{ Path, PathBuf} ;
2742+ /// use std::path::Path;
27432743 ///
27442744 /// let path = Path::new("foo.rs");
2745- /// assert_eq!(path.with_extension("txt"), PathBuf::from ("foo.txt"));
2746- /// assert_eq!(path.with_extension(""), PathBuf::from ("foo"));
2745+ /// assert_eq!(path.with_extension("txt"), Path::new ("foo.txt"));
2746+ /// assert_eq!(path.with_extension(""), Path::new ("foo"));
27472747 /// ```
27482748 ///
27492749 /// Handling multiple extensions:
27502750 ///
27512751 /// ```
2752- /// use std::path::{ Path, PathBuf} ;
2752+ /// use std::path::Path;
27532753 ///
27542754 /// let path = Path::new("foo.tar.gz");
2755- /// assert_eq!(path.with_extension("xz"), PathBuf::from ("foo.tar.xz"));
2756- /// assert_eq!(path.with_extension("").with_extension("txt"), PathBuf::from ("foo.txt"));
2755+ /// assert_eq!(path.with_extension("xz"), Path::new ("foo.tar.xz"));
2756+ /// assert_eq!(path.with_extension("").with_extension("txt"), Path::new ("foo.txt"));
27572757 /// ```
27582758 ///
27592759 /// Adding an extension where one did not exist:
27602760 ///
27612761 /// ```
2762- /// use std::path::{ Path, PathBuf} ;
2762+ /// use std::path::Path;
27632763 ///
27642764 /// let path = Path::new("foo");
2765- /// assert_eq!(path.with_extension("rs"), PathBuf::from ("foo.rs"));
2765+ /// assert_eq!(path.with_extension("rs"), Path::new ("foo.rs"));
27662766 /// ```
27672767 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
27682768 pub fn with_extension < S : AsRef < OsStr > > ( & self , extension : S ) -> PathBuf {
0 commit comments