aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Walters <rwalters@digitalstirling.com>2020-10-07 18:50:20 -0700
committerRichard Walters <rwalters@digitalstirling.com>2020-10-07 18:50:20 -0700
commitcd5cd31fbb9e8e89f0391eb81de6084471014deb (patch)
tree4736403b6c86fae37894d2e57f89df53c5dbf4e0 /src
parentdeebb1a2c4d974cb66237cc96b8e3bd5cbfe384f (diff)
(Rust) Uri::is_path_absolute: match against whole path, not first segment
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6a36c9f..40d32e4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -633,14 +633,8 @@ impl Uri {
}
fn is_path_absolute(path: &[Vec<u8>]) -> bool {
- // TODO: Explore this alternate syntax to see if it works.
- //
- // match path {
- // [segment, ..] if segment.is_empty() => true,
- // _ => false
- // }
- match path.first() {
- Some(segment) if segment.is_empty() => true,
+ match path {
+ [segment, ..] if segment.is_empty() => true,
_ => false
}
}