Explicitly set code path unreachable

This commit is contained in:
Quentin 2021-01-15 17:11:15 +01:00
parent fad7bc405b
commit f8a40e8c4f

View file

@ -176,9 +176,7 @@ fn path_to_key<'a>(path: &'a str, index: &str) -> Result<Cow<'a, str>, Error> {
} }
match path_utf8.chars().last() { match path_utf8.chars().last() {
None => Err(Error::BadRequest(format!( None => unreachable!(),
"Path must have at least a character"
))),
Some('/') => { Some('/') => {
let mut key = String::with_capacity(path_utf8.len() + index.len()); let mut key = String::with_capacity(path_utf8.len() + index.len());
key.push_str(&path_utf8[1..]); key.push_str(&path_utf8[1..]);