From 048deff9431ec538ca86f3ac010e998a4f878691 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Tue, 29 Sep 2026 01:13:21 -0400 Subject: [PATCH] other: allow clippy lint for regex creation in loops (#2270) https://github.com/rust-lang/rust-clippy/pull/17681 got merged a while ago - this makes it so the `regex_creation_in_loops` clippy `expect` "fails", since it is actually now not triggered. Unfortunately, this is only in beta from the looks of it at the moment, so I can't just remove it entirely. This change just makes it an unconditional `allow` with a note to get rid of it at some point once it's stable. Note this only affects macOS, where we use this. This was fine because it's only actually triggered once, and then cached via a `OnceLock`. --- .github/pull_request_template.md | 10 ++++++---- src/app/data/store.rs | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3630ceca..d2a608ca 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -36,10 +36,12 @@ _Ensure **all** of these are met:_ - [ ] _There are no merge conflicts_ - [ ] _You have personally reviewed your changes already before creating the PR_ - [ ] _The pull request passes the provided CI pipeline_ -- _If the changes were generated with AI tools:_ - - [ ] _Ensure it **fully** follows the [AI policy](https://github.com/ClementTsang/bottom/blob/main/AI_POLICY.md)._ - - [ ] _Specify how it was used in the "Other" section._ - - [ ] _Ensure that you, as a human, have personally reviewed the change_ + + +_If the changes were generated with AI tools:_ +- [ ] _Ensure it **fully** follows the [AI policy](https://github.com/ClementTsang/bottom/blob/main/AI_POLICY.md)._ +- [ ] _Specify how it was used in the "Other" section._ +- [ ] _Ensure that you, as a human, have personally reviewed the change_ ## Other diff --git a/src/app/data/store.rs b/src/app/data/store.rs index babc238f..a543ba76 100644 --- a/src/app/data/store.rs +++ b/src/app/data/store.rs @@ -295,7 +295,8 @@ impl InnerData { // Must trim one level further for macOS! static DISK_REGEX: OnceLock = OnceLock::new(); - #[expect( + // FIXME: Can remove this later once https://github.com/rust-lang/rust-clippy/pull/17681 lands in stable? + #[allow( clippy::regex_creation_in_loops, reason = "this is fine since it's done via a static OnceLock. In the future though, separate it out." )]