aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/uri.rs32
1 files 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<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,