From 7995cf1a6df3e602f96c50f03fdd558da87049b5 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Sat, 5 Sep 2026 20:37:39 +0100 Subject: replace match with if-let --- src/config.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/config.rs') 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 { 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 } -- cgit v1.2.3