From 3ec1de02a9caae25adfeebead4405973a0b9f7fc Mon Sep 17 00:00:00 2001 From: Paul Loyd Date: Fri, 5 Apr 2024 20:08:20 +0200 Subject: [PATCH] style: satisfy clippy new warnings --- elfo-core/src/coop.rs | 2 +- elfo-core/src/scope.rs | 2 +- elfo-macros-impl/src/errors.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/elfo-core/src/coop.rs b/elfo-core/src/coop.rs index 79d51f9f..f99c49af 100644 --- a/elfo-core/src/coop.rs +++ b/elfo-core/src/coop.rs @@ -53,7 +53,7 @@ const MAX_TIME_NS: u64 = 5_000_000; // 5ms const MAX_COUNT: u32 = 64; thread_local! { - static BUDGET: Cell = Cell::new(Budget::ByCount(0)); + static BUDGET: Cell = const { Cell::new(Budget::ByCount(0)) }; } #[derive(Debug, Clone, Copy)] diff --git a/elfo-core/src/scope.rs b/elfo-core/src/scope.rs index cde5a146..012b582c 100644 --- a/elfo-core/src/scope.rs +++ b/elfo-core/src/scope.rs @@ -312,7 +312,7 @@ pub fn try_meta() -> Option> { } thread_local! { - static SERDE_MODE: Cell = Cell::new(SerdeMode::Normal); + static SERDE_MODE: Cell = const { Cell::new(SerdeMode::Normal) }; } /// A mode of (de)serialization. diff --git a/elfo-macros-impl/src/errors.rs b/elfo-macros-impl/src/errors.rs index 767b62f2..58fed829 100644 --- a/elfo-macros-impl/src/errors.rs +++ b/elfo-macros-impl/src/errors.rs @@ -4,7 +4,7 @@ use proc_macro2::TokenStream; use syn::Error; thread_local! { - static ERROR: RefCell> = RefCell::new(None); + static ERROR: RefCell> = const { RefCell::new(None) }; } macro_rules! emit_error {