From 0ebc33e079fa41225ca4f1f817abd2778c68d24e Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Mon, 10 Jul 2023 19:41:19 -0700 Subject: [PATCH] Use `const` thread local initialization. This is newly documented but not new: https://github.com/rust-lang/rust/pull/110620 --- all-is-cubes/src/save/conversion.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/all-is-cubes/src/save/conversion.rs b/all-is-cubes/src/save/conversion.rs index f29d7087b..16b235b85 100644 --- a/all-is-cubes/src/save/conversion.rs +++ b/all-is-cubes/src/save/conversion.rs @@ -821,7 +821,9 @@ mod universe { /// TODO: Find an alternative not dependent on external state. Perhaps /// serde::DeserializeSeed will do, or if necessary we can modify URef to support /// modification after construction. - static UREF_DESERIALIZATION_CONTEXT: RefCell> = RefCell::new(None); + static UREF_DESERIALIZATION_CONTEXT: RefCell> = const { + RefCell::new(None) + }; } struct DeContext {