mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-15 00:47:01 +05:30
refactor: implement Match
for MatcherType
Delegate the responsibility of handling different `MatcherType`s to the config module.
This commit is contained in:
parent
3ea769676a
commit
4684713d7e
2 changed files with 15 additions and 9 deletions
|
@ -83,6 +83,15 @@ impl Match for Matcher<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl Match for MatcherType<'_> {
|
||||
fn check_match(&self, string: &str) -> bool {
|
||||
match self {
|
||||
Self::Single(matcher) => matcher.check_match(string),
|
||||
Self::Multiple(matchers) => matchers.iter().all(|matcher| matcher.check_match(string)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Act for Action<'_> {
|
||||
fn apply_action(&self, input: &str) -> String {
|
||||
return match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue