about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/std/src/path.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index bc24c1e65c8..c12e10eb2c0 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -2109,14 +2109,14 @@ impl Path {
     /// ```
     /// use std::path::Path;
     ///
-    /// let path = Path::new("/etc/passwd");
+    /// let path = Path::new("/etc/resolv.conf");
     ///
-    /// assert!(path.ends_with("passwd"));
-    /// assert!(path.ends_with("etc/passwd"));
-    /// assert!(path.ends_with("/etc/passwd"));
+    /// assert!(path.ends_with("resolv.conf"));
+    /// assert!(path.ends_with("etc/resolv.conf"));
+    /// assert!(path.ends_with("/etc/resolv.conf"));
     ///
-    /// assert!(!path.ends_with("/passwd"));
-    /// assert!(!path.ends_with("wd")); // use .extension() instead
+    /// assert!(!path.ends_with("/resolv.conf"));
+    /// assert!(!path.ends_with("conf")); // use .extension() instead
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn ends_with<P: AsRef<Path>>(&self, child: P) -> bool {