diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2020-10-13 12:46:34 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2020-10-13 12:46:34 -0700 |
commit | e7cdb4879610527ba00e92208625394e2835948d (patch) | |
tree | 7ebbd6debcbdbb489ef0ff1d65a542ab8c7dd61a | |
parent | 8edd5683ceb4d03e40658aef5a38d134a67adff4 (diff) |
Sort functions by alphabetical order
-rw-r--r-- | src/uri.rs | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -31,6 +31,22 @@ impl Uri { self.authority.as_ref() } + fn can_navigate_path_up_one_level<T>(path: T) -> bool + where T: AsRef<[Vec<u8>]> + { + let path = path.as_ref(); + match path.first() { + // First segment empty means path has leading slash, + // so we can only navigate up if there are two or more segments. + Some(segment) if segment.is_empty() => path.len() > 1, + + // Otherwise, we can navigate up as long as there is at least one + // segment. + Some(_) => true, + None => false + } + } + fn check_scheme<T>(scheme: T) -> Result<T, Error> where T: AsRef<str> { @@ -60,22 +76,6 @@ impl Uri { !Self::is_path_absolute(&self.path) } - fn can_navigate_path_up_one_level<T>(path: T) -> bool - where T: AsRef<[Vec<u8>]> - { - let path = path.as_ref(); - match path.first() { - // First segment empty means path has leading slash, - // so we can only navigate up if there are two or more segments. - Some(segment) if segment.is_empty() => path.len() > 1, - - // Otherwise, we can navigate up as long as there is at least one - // segment. - Some(_) => true, - None => false - } - } - fn decode_query_or_fragment<T>( query_or_fragment: T, context: Context, |