From e7cdb4879610527ba00e92208625394e2835948d Mon Sep 17 00:00:00 2001 From: Richard Walters Date: Tue, 13 Oct 2020 12:46:34 -0700 Subject: Sort functions by alphabetical order --- src/uri.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/uri.rs b/src/uri.rs index 1c6b364..6520e46 100644 --- a/src/uri.rs +++ b/src/uri.rs @@ -31,6 +31,22 @@ impl Uri { self.authority.as_ref() } + fn can_navigate_path_up_one_level(path: T) -> bool + where T: AsRef<[Vec]> + { + 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(scheme: T) -> Result where T: AsRef { @@ -60,22 +76,6 @@ impl Uri { !Self::is_path_absolute(&self.path) } - fn can_navigate_path_up_one_level(path: T) -> bool - where T: AsRef<[Vec]> - { - 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( query_or_fragment: T, context: Context, -- cgit v1.2.3