Skip to content

Commit

Permalink
Use const thread local initialization.
Browse files Browse the repository at this point in the history
This is newly documented but not new:
rust-lang/rust#110620
  • Loading branch information
kpreid committed Jul 11, 2023
1 parent cb59539 commit 0ebc33e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion all-is-cubes/src/save/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Option<DeContext>> = RefCell::new(None);
static UREF_DESERIALIZATION_CONTEXT: RefCell<Option<DeContext>> = const {
RefCell::new(None)
};
}

struct DeContext {
Expand Down

0 comments on commit 0ebc33e

Please sign in to comment.