Skip to content

Commit

Permalink
other: fix non-applicable warning about regex creation in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementTsang committed Jan 18, 2025
1 parent c9ffc41 commit 712ff9d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/data_farmer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ impl DataCollection {

// Must trim one level further for macOS!
static DISK_REGEX: OnceLock<Regex> = OnceLock::new();

#[expect(
clippy::regex_creation_in_loops,
reason = "this is fine since it's done via a static OnceLock. In the future though, separate it out."
)]
if let Some(new_name) = DISK_REGEX
.get_or_init(|| Regex::new(r"disk\d+").unwrap())
.find(checked_name)
Expand Down

0 comments on commit 712ff9d

Please sign in to comment.