chore: use std::syncLazyLock
Also migrates workspace members to Rust 2024.
This commit is contained in:
parent
b72b15d719
commit
ea349aca82
15 changed files with 64 additions and 71 deletions
|
|
@ -1,15 +1,14 @@
|
|||
use lazy_static::lazy_static;
|
||||
use palette::Srgba;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::LazyLock;
|
||||
|
||||
lazy_static! {
|
||||
/// built in light palette
|
||||
pub static ref LIGHT_PALETTE: CosmicPalette =
|
||||
ron::from_str(include_str!("light.ron")).unwrap();
|
||||
/// built in dark palette
|
||||
pub static ref DARK_PALETTE: CosmicPalette =
|
||||
ron::from_str(include_str!("dark.ron")).unwrap();
|
||||
}
|
||||
/// built-in light palette
|
||||
pub static LIGHT_PALETTE: LazyLock<CosmicPalette> =
|
||||
LazyLock::new(|| ron::from_str(include_str!("light.ron")).unwrap());
|
||||
|
||||
/// built-in dark palette
|
||||
pub static DARK_PALETTE: LazyLock<CosmicPalette> =
|
||||
LazyLock::new(|| ron::from_str(include_str!("dark.ron")).unwrap());
|
||||
|
||||
/// Palette type
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
use crate::{
|
||||
Component, Container, CornerRadii, CosmicPalette, CosmicPaletteInner, DARK_PALETTE,
|
||||
LIGHT_PALETTE, NAME, Spacing, ThemeMode,
|
||||
composite::over,
|
||||
steps::{color_index, get_small_widget_color, get_surface_color, get_text, steps},
|
||||
Component, Container, CornerRadii, CosmicPalette, CosmicPaletteInner, Spacing, ThemeMode,
|
||||
DARK_PALETTE, LIGHT_PALETTE, NAME,
|
||||
};
|
||||
use cosmic_config::{Config, CosmicConfigEntry};
|
||||
use palette::{
|
||||
color_difference::Wcag21RelativeContrast, rgb::Rgb, IntoColor, Oklcha, Srgb, Srgba, WithAlpha,
|
||||
IntoColor, Oklcha, Srgb, Srgba, WithAlpha, color_difference::Wcag21RelativeContrast, rgb::Rgb,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::num::NonZeroUsize;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue