⬆️ 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,17 +1,16 @@
|
|||
use crate::config;
|
||||
use crate::core::theme::ThemeRef;
|
||||
use crate::LazyStatic;
|
||||
|
||||
use std::sync::RwLock;
|
||||
use std::sync::{LazyLock, RwLock};
|
||||
|
||||
// THEMES ******************************************************************************************
|
||||
|
||||
pub static THEMES: LazyStatic<RwLock<Vec<ThemeRef>>> = LazyStatic::new(|| RwLock::new(Vec::new()));
|
||||
pub static THEMES: LazyLock<RwLock<Vec<ThemeRef>>> = LazyLock::new(|| RwLock::new(Vec::new()));
|
||||
|
||||
// DEFAULT THEME ***********************************************************************************
|
||||
|
||||
pub static THEME_DEFAULT: LazyStatic<ThemeRef> =
|
||||
LazyStatic::new(|| match theme_by_short_name(&config::SETTINGS.app.theme) {
|
||||
pub static THEME_DEFAULT: LazyLock<ThemeRef> =
|
||||
LazyLock::new(|| match theme_by_short_name(&config::SETTINGS.app.theme) {
|
||||
Some(theme) => theme,
|
||||
None => &crate::base::theme::Inception,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue