config-rs
config-rs copied to clipboard
Use a HashMap for a config entry without changing the case
I have a config that contains an entry watched_variables that I want to deserialize into the WatchedVariables structure defined below
{
"watched_variables": {
"PickObject": ["n_objects"],
},
}
#[derive(Clone, Debug, Default)]
pub struct WatchedVariables(pub HashMap<String, Vec<String>>);
I tried to use #derive(Deserialize) but the key gets converted to lower case.
How can I deserialize this without any modification of the key?