diff --git a/src/config.rs b/src/config.rs index 47b80f5..553fbbe 100644 --- a/src/config.rs +++ b/src/config.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use regex::Regex; use serde_derive::Deserialize; -#[derive(Clone, Debug, Default, Deserialize)] +#[derive(Clone, Debug, Deserialize)] pub struct Replacements<'config> { #[serde(rename = "substitutor", borrow, default)] pub substitutors: Vec>, diff --git a/src/main.rs b/src/main.rs index fc4a6ab..9287e08 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,11 +17,7 @@ fn main() -> Result<()> { config_path.push("config"); config_path.set_extension("toml"); let config_str = std::fs::read_to_string(config_path.as_path()).unwrap_or_default(); - let config = if config_path.exists() { - toml::from_str(&config_str)? - } else { - Replacements::default() - }; + let config: Replacements<'_> = toml::from_str(&config_str)?; let mut clipboard: ClipboardContext = ClipboardProvider::new().expect("Failed to get clipboard"); let mut clipboard_contents = get_clipboard_contents(&mut clipboard);