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`.
This commit is contained in:
Clement Tsang authored and GitHub committed 2026-09-29 05:13:21 +00:00
1 parent 520bc0cd66
commit 048deff943
2 files changed
+8 -5

No files matched your search

+6 -4
View File
@@ -36,10 +36,12 @@ _Ensure **all** of these are met:_
- [ ] _There are no merge conflicts_ - [ ] _There are no merge conflicts_
- [ ] _You have personally reviewed your changes already before creating the PR_ - [ ] _You have personally reviewed your changes already before creating the PR_
- [ ] _The pull request passes the provided CI pipeline_ - [ ] _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._ _If the changes were generated with AI tools:_
- [ ] _Ensure that you, as a human, have personally reviewed the change_ - [ ] _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 ## Other
+2 -1
View File
@@ -295,7 +295,8 @@ impl InnerData {
// Must trim one level further for macOS! // Must trim one level further for macOS!
static DISK_REGEX: OnceLock<Regex> = OnceLock::new(); static DISK_REGEX: OnceLock<Regex> = 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, clippy::regex_creation_in_loops,
reason = "this is fine since it's done via a static OnceLock. In the future though, separate it out." reason = "this is fine since it's done via a static OnceLock. In the future though, separate it out."
)] )]