fix(config): add serde default for shell integration configuration

This commit is contained in:
Alexandre Pasmantier 2025-01-26 22:01:25 +01:00
parent 4b632f81f8
commit 6a4f767ea8
2 changed files with 3 additions and 2 deletions

View File

@ -99,9 +99,9 @@ impl Config {
let path = config_dir.join(CONFIG_FILE_NAME);
let contents = std::fs::read_to_string(&path)?;
let cfg: Config = toml::from_str(&contents).unwrap_or_else(|_| {
let cfg: Config = toml::from_str(&contents).unwrap_or_else(|e| {
warn!(
"Error parsing config file, using default configuration"
"Error parsing config file, using default configuration: {}" , e
);
default_config.clone()
});

View File

@ -4,6 +4,7 @@ use rustc_hash::FxHashMap;
use serde::Deserialize;
#[derive(Clone, Debug, Deserialize, Default)]
#[serde(default)]
pub struct ShellIntegrationConfig {
pub commands: FxHashMap<String, String>,
pub keybindings: FxHashMap<String, String>,