mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-28 08:04:27 +02:00
other: fix non-applicable warning about regex creation in loop (#1661)
This commit is contained in:
parent
c9ffc41e51
commit
873434b4b7
@ -370,6 +370,11 @@ impl DataCollection {
|
|||||||
|
|
||||||
// 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(
|
||||||
|
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
|
if let Some(new_name) = DISK_REGEX
|
||||||
.get_or_init(|| Regex::new(r"disk\d+").unwrap())
|
.get_or_init(|| Regex::new(r"disk\d+").unwrap())
|
||||||
.find(checked_name)
|
.find(checked_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user