diff --git a/src/config.rs b/src/config.rs index 7f0e23f..212f011 100644 --- a/src/config.rs +++ b/src/config.rs @@ -80,13 +80,15 @@ impl Settings { } else if let Ok(env_config) = std::env::var("KEEP_CONFIG") { PathBuf::from(env_config) } else { - match Self::default_config_path() { - Ok(path) => path, - Err(e) => { - debug!("CONFIG: Failed to get default config path: {}", e); - PathBuf::from("~/.config/keep/config.yml") - } - } + let default_path = dirs::config_dir() + .map(|mut path| { + path.push("keep"); + path.push("config.yml"); + path + }) + .unwrap_or_else(|| PathBuf::from("~/.config/keep/config.yml")); + debug!("CONFIG: Using default config path: {:?}", default_path); + default_path }; debug!("CONFIG: Using config path: {:?}", config_path); diff --git a/src/modes/list.rs b/src/modes/list.rs index 9795f81..fe2d6ec 100644 --- a/src/modes/list.rs +++ b/src/modes/list.rs @@ -87,7 +87,7 @@ pub fn mode_list( let mut title_row = row!(); for column in &settings.list_format { - let column_type = ColumnType::from_str(&column.name) + let _column_type = ColumnType::from_str(&column.name) .map_err(|_| anyhow!("Unknown column {:?}", column.name))?; title_row.add_cell(Cell::new(&column.label).with_style(Attr::Bold));