File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -2140,9 +2140,8 @@ impl Path {
21402140 /// ```
21412141 /// use std::path::Path;
21422142 ///
2143- /// let path = Path::new("foo.rs");
2144- ///
2145- /// assert_eq!("foo", path.file_stem().unwrap());
2143+ /// assert_eq!("foo", Path::new("foo.rs").file_stem().unwrap());
2144+ /// assert_eq!("foo.tar", Path::new("foo.tar.gz").file_stem().unwrap());
21462145 /// ```
21472146 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
21482147 pub fn file_stem ( & self ) -> Option < & OsStr > {
@@ -2166,9 +2165,8 @@ impl Path {
21662165 /// ```
21672166 /// use std::path::Path;
21682167 ///
2169- /// let path = Path::new("foo.rs");
2170- ///
2171- /// assert_eq!("rs", path.extension().unwrap());
2168+ /// assert_eq!("rs", Path::new("foo.rs").extension().unwrap());
2169+ /// assert_eq!("gz", Path::new("foo.tar.gz").extension().unwrap());
21722170 /// ```
21732171 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
21742172 pub fn extension ( & self ) -> Option < & OsStr > {
You can’t perform that action at this time.
0 commit comments