I've lived with this warning for a long time because I didn't really understand it. ``` warning: `chessfriend_core` (lib) generated 1 warning (run `cargo fix --lib -p chessfriend_core` to apply 1 suggestion) warning: creating a shared reference to mutable static is discouraged --> bitboard/src/library.rs:66:9 ``` I was able to fix this by creating a new type with a single OnceLock attribute. The OnceLock acts as a cell, making it mutable, even if self is not. So, you can declare the MoveLibraryWrapper non-mutable static, but still initialize the library inside the Cell. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |