Skip to content

Commit 4a46306

Browse files
committed
Resolve thread_local_initializer_can_be_made_const clippy lint
warning: initializer for `thread_local` value can be made `const` --> tests/test.rs:20:34 | 20 | static CORRECT: Cell<bool> = Cell::new(false); | ^^^^^^^^^^^^^^^^ help: replace with: `const { Cell::new(false) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const = note: `-W clippy::thread-local-initializer-can-be-made-const` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::thread_local_initializer_can_be_made_const)]`
1 parent 5ceca34 commit 4a46306

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::cell::Cell;
1717
use std::ffi::CStr;
1818

1919
thread_local! {
20-
static CORRECT: Cell<bool> = Cell::new(false);
20+
static CORRECT: Cell<bool> = const { Cell::new(false) };
2121
}
2222

2323
#[no_mangle]

0 commit comments

Comments
 (0)