Skip to content

Commit 446fccf

Browse files
authored
Use resolve.conf as example for Path ends_with
1 parent 3d1388f commit 446fccf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

library/std/src/path.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2109,14 +2109,14 @@ impl Path {
21092109
/// ```
21102110
/// use std::path::Path;
21112111
///
2112-
/// let path = Path::new("/etc/passwd");
2112+
/// let path = Path::new("/etc/resolv.conf");
21132113
///
2114-
/// assert!(path.ends_with("passwd"));
2115-
/// assert!(path.ends_with("etc/passwd"));
2116-
/// assert!(path.ends_with("/etc/passwd"));
2114+
/// assert!(path.ends_with("resolv.conf"));
2115+
/// assert!(path.ends_with("etc/resolv.conf"));
2116+
/// assert!(path.ends_with("/etc/resolv.conf"));
21172117
///
2118-
/// assert!(!path.ends_with("/passwd"));
2119-
/// assert!(!path.ends_with("wd")); // use .extension() instead
2118+
/// assert!(!path.ends_with("/resolv.conf"));
2119+
/// assert!(!path.ends_with("conf")); // use .extension() instead
21202120
/// ```
21212121
#[stable(feature = "rust1", since = "1.0.0")]
21222122
pub fn ends_with<P: AsRef<Path>>(&self, child: P) -> bool {

0 commit comments

Comments
 (0)