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

[feat] add support for serde #67

Closed
wants to merge 3 commits into from
Closed

Conversation

XieJiSS
Copy link

@XieJiSS XieJiSS commented Sep 13, 2024

Scenario: One may want to deserialize into a HashMap<String, String> from, say, a config file containing a map with arbitrary keys. There's a config-rs crate for this, but due to mehcode/config-rs#531, the deserialized keys are always converted to lowercase. The consequence is catastrophic: for a Map<user_id, priority> where user_id might contain upper cased letters, anyone forgetting to add a .to_ascii_lowercase() will find None from the hash map.

Many crates also have a special serde feature for serialize/deserialize using serde_json or other similar libraries built upon the serde crate. So maybe we should add this feature into unicase as well.

@XieJiSS
Copy link
Author

XieJiSS commented Sep 13, 2024

Sorry, didn't notice that there's already #41. Will close this dup PR.

@XieJiSS XieJiSS closed this Sep 13, 2024
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

Successfully merging this pull request may close these issues.

1 participant