()
| 75 | } |
| 76 | } |
| 77 | pub fn load() -> Option<Config> { |
| 78 | let mut config_file = dirs::config_dir()?; |
| 79 | config_file.push("fblog.toml"); |
| 80 | let config_string = fs::read_to_string(config_file).ok()?; |
| 81 | match toml::from_str(&config_string) { |
| 82 | Ok(config) => Some(config), |
| 83 | Err(e) => { |
| 84 | panic!("Could not parse config file: {e}"); |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | pub fn new() -> Config { |
| 89 | Config { |
| 90 | message_keys: default_message_keys(), |