Use resolve.conf as example for Path ends_with
This commit is contained in:
parent
3d1388f514
commit
446fccf1b8
1 changed files with 6 additions and 6 deletions
|
@ -2109,14 +2109,14 @@ impl Path {
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::path::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("resolv.conf"));
|
||||||
/// assert!(path.ends_with("etc/passwd"));
|
/// assert!(path.ends_with("etc/resolv.conf"));
|
||||||
/// assert!(path.ends_with("/etc/passwd"));
|
/// assert!(path.ends_with("/etc/resolv.conf"));
|
||||||
///
|
///
|
||||||
/// assert!(!path.ends_with("/passwd"));
|
/// assert!(!path.ends_with("/resolv.conf"));
|
||||||
/// assert!(!path.ends_with("wd")); // use .extension() instead
|
/// assert!(!path.ends_with("conf")); // use .extension() instead
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub fn ends_with<P: AsRef<Path>>(&self, child: P) -> bool {
|
pub fn ends_with<P: AsRef<Path>>(&self, child: P) -> bool {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue