Skip to content

Commit 4b549fa

Browse files
pickfireJoshua Nelson
and
Joshua Nelson
authored
show multiple slashes starts_with Path example
Co-authored-by: Joshua Nelson <[email protected]>
1 parent e7e41a8 commit 4b549fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/std/src/path.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,8 @@ impl Path {
20872087
/// assert!(path.starts_with("/etc"));
20882088
/// assert!(path.starts_with("/etc/"));
20892089
/// assert!(path.starts_with("/etc/passwd"));
2090-
/// assert!(path.starts_with("/etc/passwd/")); // extra slash(es) is okay
2090+
/// assert!(path.starts_with("/etc/passwd/")); // extra slash is okay
2091+
/// assert!(path.starts_with("/etc/passwd///")); // multiple extra slashes are okay
20912092
///
20922093
/// assert!(!path.starts_with("/e"));
20932094
/// assert!(!path.starts_with("/etc/passwd.txt"));

0 commit comments

Comments
 (0)