aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Walters <rwalters@digitalstirling.com>2020-12-21 16:00:27 -0800
committerRichard Walters <rwalters@digitalstirling.com>2020-12-21 16:00:27 -0800
commitc7f094e59d67c75bae58fe44891fcf8bd5a4f773 (patch)
tree43116b0e9583f9f8530eda0cd40a62e3ac1378e7
parent3bb865d0a3eab0527f5be276aa90e565f39d41de (diff)
Fix compiler warning
-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('/')