diff options
| author | Joe Carstairs <me@joeac.net> | 2026-09-05 20:37:39 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-09-05 20:37:39 +0100 |
| commit | 7995cf1a6df3e602f96c50f03fdd558da87049b5 (patch) | |
| tree | 393e3d54a332487c85ed6408c451ccae7af0478a /src | |
| parent | 8594f2959cf1f58825b0d6e1fb3c175d87a6e74c (diff) | |
replace match with if-let
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/config.rs b/src/config.rs index 5d63bd3..089d3e2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -12,11 +12,10 @@ pub fn default_config_file_locations() -> Vec<String> { let mut default_config_file_locations = vec![ String::from("/etc/rss-aggregator.toml"), ]; - match dirs::config_dir().and_then(|config_dir| config_dir.into_string().ok()) { - Some(config_dir) => { - default_config_file_locations.push(format!("{config_dir}/rss-aggregator.toml")); - }, - _ => {}, + let config_dir = dirs::config_dir() + .and_then(|config_dir| config_dir.into_string().ok()); + if let Some(config_dir) = config_dir { + default_config_file_locations.push(format!("{config_dir}/rss-aggregator.toml")); }; default_config_file_locations } |
