⬆️ Replace LazyStatic with new std::sync::LazyLock

This commit is contained in:
Manuel Cillero 2024-07-27 14:00:27 +02:00
parent 2caa7e924b
commit dfb34d2e36
13 changed files with 67 additions and 62 deletions

View file

@ -1,12 +1,11 @@
use crate::core::action::{ActionBox, ActionKey, ActionTrait, ActionsList};
use crate::LazyStatic;
use std::collections::HashMap;
use std::sync::RwLock;
use std::sync::{LazyLock, RwLock};
// Registered actions.
static ACTIONS: LazyStatic<RwLock<HashMap<ActionKey, ActionsList>>> =
LazyStatic::new(|| RwLock::new(HashMap::new()));
static ACTIONS: LazyLock<RwLock<HashMap<ActionKey, ActionsList>>> =
LazyLock::new(|| RwLock::new(HashMap::new()));
pub fn add_action(action: ActionBox) {
let key = action.key();