Skip to content

Commit

Permalink
[Misc]: bumping up fancy-regex to 0.12.0 so we can take advantage of …
Browse files Browse the repository at this point in the history
…try_from trait (#427)
  • Loading branch information
joshfried-aws committed Dec 5, 2023
1 parent 05f4793 commit 487c125
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion guard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ grep-matcher = "0.1.5"
grep-regex = "0.1.9"
unsafe-libyaml = "0.2.2"
rstest = "0.15.0"
fancy-regex = "0.11.0"
fancy-regex = "0.12.0"
indoc = "1.0.8"
thiserror = "1.0.38"

Expand Down
3 changes: 1 addition & 2 deletions guard/src/rules/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ fn parse_regex_inner(input: Span) -> IResult<Span, Value> {

regex.push_str(fragment);

let validate_regex = Regex::new(regex.as_str());
return match validate_regex {
return match Regex::try_from(regex.as_str()) {
Ok(_) => Ok((remainder, Value::Regex(regex))),
Err(e) => Err(nom::Err::Error(ParserError {
context: format!("Could not parse regular expression: {}", e),
Expand Down

0 comments on commit 487c125

Please sign in to comment.