Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a HashMap for a config entry without changing the case #577

Open
galou opened this issue Sep 24, 2024 · 0 comments
Open

Use a HashMap for a config entry without changing the case #577

galou opened this issue Sep 24, 2024 · 0 comments

Comments

@galou
Copy link

galou commented Sep 24, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant