diff options
author | Ivan Tham <pickfire@riseup.net> | 2020-08-15 17:25:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-15 17:25:07 +0800 |
commit | 446fccf1b8b95f78cbefedb01c4acc6e1f77adbb (patch) | |
tree | 91fbda46dc8e950cd366a7147d96cd75cdf31861 | |
parent | 3d1388f514ab18ad798251f511c54097ba5c60ca (diff) | |
download | rust-446fccf1b8b95f78cbefedb01c4acc6e1f77adbb.tar.gz |
Use resolve.conf as example for Path ends_with
-rw-r--r-- | library/std/src/path.rs | 12 |
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 { |