summaryrefslogtreecommitdiffstats
path: root/src/app/data_farmer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/data_farmer.rs')
-rw-r--r--src/app/data_farmer.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/app/data_farmer.rs b/src/app/data_farmer.rs
index 46eb32f2..73881a4b 100644
--- a/src/app/data_farmer.rs
+++ b/src/app/data_farmer.rs
@@ -364,13 +364,12 @@ impl DataCollection {
let io_device = {
cfg_if::cfg_if! {
if #[cfg(target_os = "macos")] {
- use once_cell::sync::Lazy;
+ use std::sync::OnceLock;
use regex::Regex;
// Must trim one level further for macOS!
- static DISK_REGEX: Lazy<Regex> =
- Lazy::new(|| Regex::new(r"disk\d+").unwrap());
- if let Some(new_name) = DISK_REGEX.find(checked_name) {
+ static DISK_REGEX: OnceLock<Regex> = OnceLock::new();
+ if let Some(new_name) = DISK_REGEX.get_or_init(|| Regex::new(r"disk\d+").unwrap()).find(checked_name) {
io.get(new_name.as_str())
} else {
None