mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-14 22:27:03 +05:30
refactor: do not derive Clone in config structs
This commit is contained in:
parent
381c3cc0b5
commit
0f67855571
1 changed files with 4 additions and 4 deletions
|
@ -3,13 +3,13 @@ use std::str::FromStr;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use serde_derive::Deserialize;
|
use serde_derive::Deserialize;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
pub struct Replacements<'config> {
|
pub struct Replacements<'config> {
|
||||||
#[serde(rename = "substitutor", borrow, default)]
|
#[serde(rename = "substitutor", borrow, default)]
|
||||||
pub substitutors: Vec<Substitutor<'config>>,
|
pub substitutors: Vec<Substitutor<'config>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
pub struct Substitutor<'config> {
|
pub struct Substitutor<'config> {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub name: &'config str,
|
pub name: &'config str,
|
||||||
|
@ -19,7 +19,7 @@ pub struct Substitutor<'config> {
|
||||||
pub action: Action<'config>,
|
pub action: Action<'config>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
pub enum Matcher<'config> {
|
pub enum Matcher<'config> {
|
||||||
#[serde(rename = "starts_with")]
|
#[serde(rename = "starts_with")]
|
||||||
StartsWith { prefix: &'config str },
|
StartsWith { prefix: &'config str },
|
||||||
|
@ -33,7 +33,7 @@ pub enum Matcher<'config> {
|
||||||
Exactly { content: &'config str },
|
Exactly { content: &'config str },
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
pub enum Action<'config> {
|
pub enum Action<'config> {
|
||||||
#[serde(rename = "set")]
|
#[serde(rename = "set")]
|
||||||
Set { content: &'config str },
|
Set { content: &'config str },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue