Let's say I have a struct
struct Foo {
color: String
}
impl Default for Foo {
fun default() -> Self {
Foo { color: "red".to_string(), }
}
}
Now, if the file ~/.configs/Foo/settings.conf
exists, and it has a field color: <color_name>
I want my src code to change the default
value of a color
so next time I don't have to do I/O on the settings file again?
What options do I have? (lower latency option is preferred) An optimal way to read settings from the file, set them up once without a need to do IO, and set default values every time the program is executed. Do I write some meta program that updates the source code?
thanks