use LazyLock instead of lazy_static
This commit is contained in:
@@ -5,8 +5,7 @@ use super::{
|
||||
CoordAxis, CoordPair,
|
||||
};
|
||||
use const_fn::const_fn;
|
||||
use lazy_static::lazy_static;
|
||||
use std::{cmp::Ordering, fmt};
|
||||
use std::{cmp::Ordering, fmt, sync::LazyLock};
|
||||
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
||||
pub enum Winner {
|
||||
@@ -15,10 +14,8 @@ pub enum Winner {
|
||||
None,
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
/// Precompute all possible chains for each position on the board
|
||||
static ref ADJ_LOOKUP: PosMap<ChainCollection> = gen_adj_lookup();
|
||||
}
|
||||
/// Precompute all possible chains for each position on the board
|
||||
static ADJ_LOOKUP: LazyLock<PosMap<ChainCollection>> = LazyLock::new(|| gen_adj_lookup());
|
||||
|
||||
/// Repersents a Othello game board at a certain space
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
|
||||
Reference in New Issue
Block a user