Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHarden util::prefs setting/resetting #10676
Open
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 eitherpanic!or returnResult::Err(I don't have strong opinions between these two options). If adding new keys at runtime (that don't exist inresources/prefs.json) is something we need to support, I suggest there be a separate function callednew_prefor something similar. Thoughts?