Skip to content

Commit

Permalink
Clippy appeasement: ignore regex creation in loops for the test.
Browse files Browse the repository at this point in the history
  • Loading branch information
amanjeev committed Jan 9, 2025
1 parent 46bba35 commit dc2d2ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/criticalup-cli/tests/cli/auth_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ macro_rules! run_cmd {
.expect("failed to execute command");
match &$expected {
Some(expected) => {
// this regex replacement dance is required because this nested macro tests
// Since 1.84, stable Rust Clippy will complain about Regex inside a for loop.
// Unblocking ourselves by ignoring this warning in tests.
#[allow(clippy::regex_creation_in_loops)]
// This regex replacement dance is required because this nested macro tests
// set is instantiating the test server twice which means each run gives
// a different local port. we replace with a stable port just for this test.
// a different local port. We replace with a stable port just for this test.
let re = Regex::new(r"127.0.0.1:\d+").expect("regex creation failed.");
let left_str = String::from_utf8(out.stderr.clone())
.expect("string creation from bytes failed.");
Expand Down

0 comments on commit dc2d2ab

Please sign in to comment.