summaryrefslogtreecommitdiffstats
path: root/style/src/theme
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-11-01 20:18:42 +0100
committerLibravatar GitHub <noreply@github.com>2022-11-01 20:18:42 +0100
commit1c00adad615f7c2909d175c696765dbe081bde33 (patch)
tree76ac2acb891cdf6cde7b00e33da600837cfcc97f /style/src/theme
parent37c5b15f62ef44e52e49032a2972a76aa653436a (diff)
parent743a7192b70bc5184aa47e7851098b75b8a1f288 (diff)
downloadiced-1c00adad615f7c2909d175c696765dbe081bde33.tar.gz
iced-1c00adad615f7c2909d175c696765dbe081bde33.tar.bz2
iced-1c00adad615f7c2909d175c696765dbe081bde33.zip
Merge pull request #1497 from ids1024/once_cell
Use `once_cell` instead of `lazy_static`
Diffstat (limited to 'style/src/theme')
-rw-r--r--style/src/theme/palette.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/style/src/theme/palette.rs b/style/src/theme/palette.rs
index 81aa9cc7..4fb5e4c8 100644
--- a/style/src/theme/palette.rs
+++ b/style/src/theme/palette.rs
@@ -1,6 +1,6 @@
use iced_core::Color;
-use lazy_static::lazy_static;
+use once_cell::sync::Lazy;
use palette::{FromColor, Hsl, Mix, RelativeContrast, Srgb};
#[derive(Debug, Clone, Copy, PartialEq)]
@@ -66,11 +66,10 @@ pub struct Extended {
pub danger: Danger,
}
-lazy_static! {
- pub static ref EXTENDED_LIGHT: Extended =
- Extended::generate(Palette::LIGHT);
- pub static ref EXTENDED_DARK: Extended = Extended::generate(Palette::DARK);
-}
+pub static EXTENDED_LIGHT: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::LIGHT));
+pub static EXTENDED_DARK: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::DARK));
impl Extended {
pub fn generate(palette: Palette) -> Self {