File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -2140,9 +2140,8 @@ impl Path {
2140
2140
/// ```
2141
2141
/// use std::path::Path;
2142
2142
///
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());
2146
2145
/// ```
2147
2146
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2148
2147
pub fn file_stem ( & self ) -> Option < & OsStr > {
@@ -2166,9 +2165,8 @@ impl Path {
2166
2165
/// ```
2167
2166
/// use std::path::Path;
2168
2167
///
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());
2172
2170
/// ```
2173
2171
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2174
2172
pub fn extension ( & self ) -> Option < & OsStr > {
You can’t perform that action at this time.
0 commit comments