Skip to content

Commit 4c835c3

Browse files
perf: make initializer for NULL_DEVICE value const
1 parent c659225 commit 4c835c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test_utils/null_device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use sha2::{Digest, Sha256};
33
use std::{cell::OnceCell, process::Stdio, sync::OnceLock};
44

55
thread_local! {
6-
static NULL_DEVICE: OnceCell<NullPrinterDevice> = OnceCell::new();
6+
static NULL_DEVICE: OnceCell<NullPrinterDevice> = const { OnceCell::new() };
77
}
88
static DEVICE_ID_COUNTER: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
99
static PORT_AND_DRIVER_INSTALLER: OnceLock<()> = OnceLock::new();

0 commit comments

Comments
 (0)