⬆️ Replace LazyStatic with new std::sync::LazyLock
This commit is contained in:
parent
2caa7e924b
commit
dfb34d2e36
13 changed files with 67 additions and 62 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue