diff --git a/src/config/mod.rs b/src/config/mod.rs index a5b89c1..a5d1e4a 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -100,7 +100,7 @@ impl Config { } pub fn tealdeer(&self) -> bool { - self.yaml.client.tealdeer.clone() + self.yaml.client.tealdeer } pub fn shell(&self) -> String { diff --git a/src/config/yaml.rs b/src/config/yaml.rs index 6a080bc..868411b 100644 --- a/src/config/yaml.rs +++ b/src/config/yaml.rs @@ -80,6 +80,7 @@ pub struct Shell { #[derive(Deserialize, Debug)] #[serde(default)] +#[derive(Default)] pub struct Client { pub tealdeer: bool, } @@ -169,9 +170,3 @@ impl Default for Shell { } } } - -impl Default for Client { - fn default() -> Self { - Self { tealdeer: false } - } -} diff --git a/src/finder/mod.rs b/src/finder/mod.rs index 77d129a..a1edee6 100644 --- a/src/finder/mod.rs +++ b/src/finder/mod.rs @@ -81,12 +81,10 @@ impl FinderChoice { && patch < MIN_FZF_VERSION_PATCH { eprintln!( - "Warning: Fzf version {}.{} does not support the preview window layout used by navi.", - major, minor + "Warning: Fzf version {major}.{minor} does not support the preview window layout used by navi.", ); eprintln!( - "Consider updating Fzf to a version >= {}.{}.{} or use a compatible layout.", - MIN_FZF_VERSION_MAJOR, MIN_FZF_VERSION_MINOR, MIN_FZF_VERSION_PATCH + "Consider updating Fzf to a version >= {MIN_FZF_VERSION_MAJOR}.{MIN_FZF_VERSION_MINOR}.{MIN_FZF_VERSION_PATCH} or use a compatible layout.", ); process::exit(1); }