Use default key config and theme when values are missing#735
Use default key config and theme when values are missing#735hpcsc wants to merge 3 commits intogitui-org:masterfrom
Conversation
There was a problem hiding this comment.
ok I checked this out and I like that we try to fix this issue of breaking the configs every time we add stuff. but the files get bloated a lot using this approach where we need a separate method for each field. I wonder if we can find a more elegant solution using custom serialise: https://serde.rs/deserialize-struct.html
in a perfect world we can detect a missing field and only pick that off the Default::default and keep this as is.
let me know if you can find a solution like this (I did not try it myself yet), for the time being I mark this PR as draft again.
| rc::Rc, | ||
| }; | ||
|
|
||
| use anyhow::Result; |
There was a problem hiding this comment.
what is this reordering good for?
| rc::Rc, | ||
| }; | ||
|
|
||
| use anyhow::Result; |
There was a problem hiding this comment.
needless reorders again, this confuses the review
|
Superseded by optional overwrites in key config |
Background
What is in this PR?
serde(default = "path")for fields in key config and theme to specify default values if they are missing from config files during deserialization. This does create a bunch of private functions (default_xxx()) but this is the only way that I can see from serde documentation