diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2020-12-21 16:00:27 -0800 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2020-12-21 16:00:27 -0800 |
commit | c7f094e59d67c75bae58fe44891fcf8bd5a4f773 (patch) | |
tree | 43116b0e9583f9f8530eda0cd40a62e3ac1378e7 /src/uri.rs | |
parent | 3bb865d0a3eab0527f5be276aa90e565f39d41de (diff) |
Fix compiler warning
Diffstat (limited to 'src/uri.rs')
-rw-r--r-- | src/uri.rs | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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('/') |