about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/path.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 4471b5afa84..9215c93ca1c 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -1574,7 +1574,8 @@ impl Path {
     ///
     /// let path = Path::new("/tmp/foo.rs");
     ///
-    /// let new_path = path.with_extension("foo.txt");
+    /// let new_path = path.with_extension("txt");
+    /// assert_eq!(new_path, PathBuf::from("/tmp/foo.txt"));
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn with_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf {