mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-14 18:57:02 +05:30
config: remove unnecessary Default impl
This commit is contained in:
parent
13bcb918bd
commit
d2f1b686a2
2 changed files with 2 additions and 6 deletions
|
@ -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<Substitutor<'config>>,
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue