Use atomics instead of mutexes

Use atomics instead of mutexes to improve access on metrics. Therefor
also remove unneeded borrows.
This commit is contained in:
finga 2021-11-13 14:35:40 +01:00
parent b4b46ebd58
commit a122bf28d2
2 changed files with 38 additions and 57 deletions

View file

@ -74,7 +74,7 @@ impl JsonFilter {
let regex = Regex::new(&self.regex).map_err(WebhookeyError::Regex)?;
if let Some(value) = data.pointer(&self.pointer) {
if regex.is_match(&self.get_string(&value)?) {
if regex.is_match(&self.get_string(value)?) {
debug!("Regex `{}` for `{}` matches", &self.regex, &self.pointer);
return Ok(true);