From 163f751e3a85e5f5b945b64de858ade6a8ac2254 Mon Sep 17 00:00:00 2001 From: Bas Zalmstra Date: Fri, 1 Mar 2024 11:55:21 +0100 Subject: [PATCH] fix: formatting --- crates/rattler_conda_types/src/version_spec/parse.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/rattler_conda_types/src/version_spec/parse.rs b/crates/rattler_conda_types/src/version_spec/parse.rs index a9c3bddec..1854b4b1e 100644 --- a/crates/rattler_conda_types/src/version_spec/parse.rs +++ b/crates/rattler_conda_types/src/version_spec/parse.rs @@ -87,13 +87,11 @@ fn regex_constraint_parser(input: &str) -> IResult<&str, Constraint, ParseConstr let (_rest, (preceder, _, terminator)) = tuple((opt(char('^')), take_while(|c| c != '$'), opt(char('$'))))(input)?; match (preceder, terminator) { - (None, None) => Err(nom::Err::Error( - ParseConstraintError::UnterminatedRegex, + (None, None) => Err(nom::Err::Error(ParseConstraintError::UnterminatedRegex)), + (_, None) | (None, _) => Err(nom::Err::Failure(ParseConstraintError::UnterminatedRegex)), + _ => Err(nom::Err::Failure( + ParseConstraintError::RegexConstraintsNotSupported, )), - (_, None)|(None, _) => Err(nom::Err::Failure( - ParseConstraintError::UnterminatedRegex, - )), - _ => Err(nom::Err::Failure(ParseConstraintError::RegexConstraintsNotSupported)) } }