diff --git a/src/config.rs b/src/config.rs index e6533ea..986d944 100644 --- a/src/config.rs +++ b/src/config.rs @@ -66,7 +66,7 @@ impl Replacements { } } MatcherType::Multiple(matchers) => { - for matcher in matchers.iter() { + for matcher in matchers { if let Matcher::Regex { pattern } = matcher { if let Err(e) = Regex::from_str(pattern) { bail!(e); @@ -115,8 +115,8 @@ impl Act for Action { trace!(?self, ?input, "Applying action"); match self { Action::Replace { from, to } => input.replace(from, to), - Action::Prefix { prefix } => format!("{}{}", prefix, input), - Action::Suffix { suffix } => format!("{}{}", input, suffix), + Action::Prefix { prefix } => format!("{prefix}{input}"), + Action::Suffix { suffix } => format!("{input}{suffix}"), Action::Set { content } => content.clone(), } } diff --git a/src/test.rs b/src/test.rs index ba1531b..2df5dbe 100644 --- a/src/test.rs +++ b/src/test.rs @@ -88,7 +88,7 @@ matcher = { regex = { pattern = "^https://(?P(?:mobile.)?twitter.com)/.*/s action = { replace = { from = "twitter.com", to = "vxtwitter.com" } } "#; let config: Replacements = toml::from_str(config)?; - assert!(matches!(config.validate(), Ok(_))); + assert!(config.validate().is_ok()); } #[assay] @@ -100,5 +100,5 @@ matcher = { regex = { pattern = "^https://(?P<>(?:mobile.)?twitter.com)/.*/statu action = { replace = { from = "twitter.com", to = "vxtwitter.com" } } "#; let config: Replacements = toml::from_str(config)?; - assert!(matches!(config.validate(), Err(_))); + assert!(config.validate().is_err()); }