diff options
| author | Ivan Tham <pickfire@riseup.net> | 2020-08-10 00:43:45 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-10 00:43:45 +0800 |
| commit | 4b549fa043486b10673d69ba547522238bb2f25f (patch) | |
| tree | 24b76106732ed8d08f28f0a011fd5bb636c74208 | |
| parent | e7e41a846578de9c1dc1ccf8ac4bbb0a3a5dea60 (diff) | |
| download | rust-4b549fa043486b10673d69ba547522238bb2f25f.tar.gz rust-4b549fa043486b10673d69ba547522238bb2f25f.zip | |
show multiple slashes starts_with Path example
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
| -rw-r--r-- | library/std/src/path.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs index e8aa9e27c0f..e543006e394 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -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")); |
