aboutsummaryrefslogtreecommitdiff
path: root/src/web/web_server.rs
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2021-01-15 17:11:15 +0100
committerQuentin <quentin@deuxfleurs.fr>2021-01-15 17:11:15 +0100
commitf8a40e8c4f69c20045aaffc4caf51158d697e792 (patch)
tree4d8fc193765924b6f572042262f2489ab8b6be64 /src/web/web_server.rs
parentfad7bc405bd8b3cf1dc9a9319a7e3ee0e1eb3461 (diff)
downloadgarage-f8a40e8c4f69c20045aaffc4caf51158d697e792.tar.gz
garage-f8a40e8c4f69c20045aaffc4caf51158d697e792.zip
Explicitly set code path unreachable
Diffstat (limited to 'src/web/web_server.rs')
-rw-r--r--src/web/web_server.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/web/web_server.rs b/src/web/web_server.rs
index 246c045f..aab7e8de 100644
--- a/src/web/web_server.rs
+++ b/src/web/web_server.rs
@@ -176,9 +176,7 @@ fn path_to_key<'a>(path: &'a str, index: &str) -> Result<Cow<'a, str>, Error> {
}
match path_utf8.chars().last() {
- None => Err(Error::BadRequest(format!(
- "Path must have at least a character"
- ))),
+ None => unreachable!(),
Some('/') => {
let mut key = String::with_capacity(path_utf8.len() + index.len());
key.push_str(&path_utf8[1..]);