From f8a40e8c4f69c20045aaffc4caf51158d697e792 Mon Sep 17 00:00:00 2001 From: Quentin Date: Fri, 15 Jan 2021 17:11:15 +0100 Subject: [PATCH] Explicitly set code path unreachable --- src/web/web_server.rs | 4 +--- 1 file changed, 1 insertion(+), 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, 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..]);