diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2020-10-07 18:50:20 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2020-10-07 18:50:20 -0700 |
commit | cd5cd31fbb9e8e89f0391eb81de6084471014deb (patch) | |
tree | 4736403b6c86fae37894d2e57f89df53c5dbf4e0 | |
parent | deebb1a2c4d974cb66237cc96b8e3bd5cbfe384f (diff) |
(Rust) Uri::is_path_absolute: match against whole path, not first segment
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -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 } } |