Remove some and deny new indexing and slicing

This commit is contained in:
Alexander Krotov
2020-06-22 02:07:10 +03:00
committed by link2xt
parent ee7b7eb4f2
commit 18e4abc1df
18 changed files with 107 additions and 95 deletions

View File

@@ -171,7 +171,7 @@ impl str::FromStr for Params {
let key = key.unwrap_or_default().trim();
let value = value.unwrap_or_default().trim();
if let Some(key) = Param::from_u8(key.as_bytes()[0]) {
if let Some(key) = key.as_bytes().first().and_then(|key| Param::from_u8(*key)) {
inner.insert(key, value.to_string());
} else {
bail!("Unknown key: {}", key);