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

Fixes #318
This commit is contained in:
Alex Pasmantier 2025-01-26 22:02:44 +01:00 committed by GitHub
parent 4b632f81f8
commit f536156e7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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>,