diff --git a/milu/src/parser/string.rs b/milu/src/parser/string.rs index 13754205..41002b86 100644 --- a/milu/src/parser/string.rs +++ b/milu/src/parser/string.rs @@ -9,10 +9,6 @@ //! - an escape followed by whitespace consumes all whitespace between the //! escape and the next non-whitespace character -// #![cfg(feature = "alloc")] -// #[global_allocator] -// static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; - use nom::branch::alt; use nom::bytes::streaming::{is_not, take_while_m_n}; use nom::character::streaming::{char, multispace1}; diff --git a/src/rules/mod.rs b/src/rules/mod.rs index 46135508..d9844625 100644 --- a/src/rules/mod.rs +++ b/src/rules/mod.rs @@ -120,16 +120,16 @@ impl Rule { rules_metrics().execute_time.start_timer() }; let t = Instant::now(); - let ret = if self.filter.is_none() { - true - } else { - match self.filter.as_ref().unwrap().evaluate(request).await { + let ret = if let Some(filter) = self.filter.as_ref() { + match filter.evaluate(request).await { Ok(b) => b, Err(e) => { trace!("error evaluating filter: {:?}", e); false } } + } else { + true }; let t = t.elapsed().as_nanos() as u64; #[cfg(feature = "metrics")]