parent
4e8afd65f9
commit
02b8e4e6cf
1 changed files with 6 additions and 0 deletions
|
@ -1449,6 +1449,8 @@ impl Path {
|
|||
|
||||
/// Determines whether `base` is a prefix of `self`.
|
||||
///
|
||||
/// Only considers whole path components to match.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
@ -1457,6 +1459,8 @@ impl Path {
|
|||
/// let path = Path::new("/etc/passwd");
|
||||
///
|
||||
/// assert!(path.starts_with("/etc"));
|
||||
///
|
||||
/// assert!(!path.starts_with("/e"));
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn starts_with<P: AsRef<Path>>(&self, base: P) -> bool {
|
||||
|
@ -1465,6 +1469,8 @@ impl Path {
|
|||
|
||||
/// Determines whether `child` is a suffix of `self`.
|
||||
///
|
||||
/// Only considers whole path components to match.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
|
Loading…
Reference in a new issue