diff --git a/influxdb_influxql_parser/src/expression/conditional.rs b/influxdb_influxql_parser/src/expression/conditional.rs index e00baefff4..f34d696cdd 100644 --- a/influxdb_influxql_parser/src/expression/conditional.rs +++ b/influxdb_influxql_parser/src/expression/conditional.rs @@ -260,10 +260,7 @@ pub fn parse_conditional_expression(input: &str) -> Result i1, - _ => unreachable!("ws0 is infallible"), - }; + (i, _) = ws0(i).expect("ws0 is infallible"); if i.is_empty() { return Err(ParseError { @@ -293,10 +290,7 @@ pub fn parse_conditional_expression(input: &str) -> Result i1, - _ => unreachable!("ws0 is infallible"), - }; + (i, _) = ws0(i).expect("ws0 is infallible"); if !i.is_empty() { return Err(ParseError { diff --git a/influxdb_influxql_parser/src/lib.rs b/influxdb_influxql_parser/src/lib.rs index 751d15367f..4bb1a60db2 100644 --- a/influxdb_influxql_parser/src/lib.rs +++ b/influxdb_influxql_parser/src/lib.rs @@ -69,10 +69,7 @@ pub fn parse_statements(input: &str) -> ParseResult { loop { // Consume whitespace from the input - i = match ws0(i) { - Ok((i1, _)) => i1, - _ => unreachable!("ws0 is infallible"), - }; + (i, _) = ws0(i).expect("ws0 is infallible"); if eof::<_, nom::error::Error<_>>(i).is_ok() { return Ok(res);