aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/uri.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/uri.rs b/src/uri.rs
index f318bf6..5f72d76 100644
--- a/src/uri.rs
+++ b/src/uri.rs
@@ -689,10 +689,9 @@ impl Uri {
{
// Split authority from path. If there is an authority, parse it.
let authority_and_path_string = authority_and_path_string.as_ref();
- if authority_and_path_string.starts_with("//") {
- // Strip off authority marker.
- let authority_and_path_string = &authority_and_path_string[2..];
-
+ if let Some(authority_and_path_string) =
+ authority_and_path_string.strip_prefix("//")
+ {
// First separate the authority from the path.
let authority_end = authority_and_path_string
.find('/')