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

Harden util::prefs setting/resetting #10676

Open
frewsxcv opened this issue Apr 17, 2016 · 0 comments
Open

Harden util::prefs setting/resetting #10676

frewsxcv opened this issue Apr 17, 2016 · 0 comments

Comments

@frewsxcv
Copy link
Member

@frewsxcv frewsxcv commented Apr 17, 2016

Right now, it's very easy to make typos with key names when working with util::prefs. In an attempt to make the system less-error-prone, I propose that setting (util::prefs::set_pref) and resetting (util::prefs::reset_pref) only work on keys that already exist in the underlying map structure. If they don't exist, we either panic! or return Result::Err (I don't have strong opinions between these two options). If adding new keys at runtime (that don't exist in resources/prefs.json) is something we need to support, I suggest there be a separate function called new_pref or something similar. Thoughts?

@frewsxcv frewsxcv changed the title Hardening prefs setting/resetting Harden util::prefs setting/resetting Apr 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.