We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63e3442 commit 3d1388fCopy full SHA for 3d1388f
library/std/src/path.rs
@@ -2112,6 +2112,11 @@ impl Path {
2112
/// let path = Path::new("/etc/passwd");
2113
///
2114
/// assert!(path.ends_with("passwd"));
2115
+ /// assert!(path.ends_with("etc/passwd"));
2116
+ /// assert!(path.ends_with("/etc/passwd"));
2117
+ ///
2118
+ /// assert!(!path.ends_with("/passwd"));
2119
+ /// assert!(!path.ends_with("wd")); // use .extension() instead
2120
/// ```
2121
#[stable(feature = "rust1", since = "1.0.0")]
2122
pub fn ends_with<P: AsRef<Path>>(&self, child: P) -> bool {
0 commit comments