Skip to content

Commit

Permalink
show multiple slashes starts_with Path example
Browse files Browse the repository at this point in the history
Co-authored-by: Joshua Nelson <[email protected]>
  • Loading branch information
pickfire and Joshua Nelson authored Aug 9, 2020
1 parent e7e41a8 commit 4b549fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2087,7 +2087,8 @@ impl Path {
/// assert!(path.starts_with("/etc"));
/// assert!(path.starts_with("/etc/"));
/// assert!(path.starts_with("/etc/passwd"));
/// assert!(path.starts_with("/etc/passwd/")); // extra slash(es) is okay
/// assert!(path.starts_with("/etc/passwd/")); // extra slash is okay
/// assert!(path.starts_with("/etc/passwd///")); // multiple extra slashes are okay
///
/// assert!(!path.starts_with("/e"));
/// assert!(!path.starts_with("/etc/passwd.txt"));
Expand Down

0 comments on commit 4b549fa

Please sign in to comment.