mirror of
https://github.com/chatmail/core.git
synced 2026-04-18 22:16:30 +03:00
Remove some and deny new indexing and slicing
This commit is contained in:
committed by
link2xt
parent
ee7b7eb4f2
commit
18e4abc1df
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user