chore: remove once_cell dependency

This commit is contained in:
Tommy Volk 2024-10-03 22:27:25 -05:00 committed by Héctor Ramón Jiménez
parent b156087fcf
commit 0e8c3fe30f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
20 changed files with 80 additions and 96 deletions

9
Cargo.lock generated
View file

@ -2435,7 +2435,6 @@ dependencies = [
"glam", "glam",
"log", "log",
"num-traits", "num-traits",
"once_cell",
"palette", "palette",
"rustc-hash 2.1.0", "rustc-hash 2.1.0",
"smol_str", "smol_str",
@ -2472,7 +2471,6 @@ dependencies = [
"kamadak-exif", "kamadak-exif",
"log", "log",
"lyon_path", "lyon_path",
"once_cell",
"raw-window-handle 0.6.2", "raw-window-handle 0.6.2",
"rustc-hash 2.1.0", "rustc-hash 2.1.0",
"thiserror 1.0.69", "thiserror 1.0.69",
@ -2484,7 +2482,6 @@ name = "iced_highlighter"
version = "0.14.0-dev" version = "0.14.0-dev"
dependencies = [ dependencies = [
"iced_core", "iced_core",
"once_cell",
"syntect", "syntect",
] ]
@ -2549,7 +2546,6 @@ dependencies = [
"iced_graphics", "iced_graphics",
"log", "log",
"lyon", "lyon",
"once_cell",
"resvg", "resvg",
"rustc-hash 2.1.0", "rustc-hash 2.1.0",
"thiserror 1.0.69", "thiserror 1.0.69",
@ -2564,7 +2560,6 @@ dependencies = [
"iced_renderer", "iced_renderer",
"iced_runtime", "iced_runtime",
"num-traits", "num-traits",
"once_cell",
"ouroboros", "ouroboros",
"pulldown-cmark", "pulldown-cmark",
"qrcode", "qrcode",
@ -3066,7 +3061,6 @@ version = "0.1.0"
dependencies = [ dependencies = [
"iced", "iced",
"lyon_algorithms", "lyon_algorithms",
"once_cell",
] ]
[[package]] [[package]]
@ -4738,7 +4732,6 @@ name = "scrollable"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"iced", "iced",
"once_cell",
] ]
[[package]] [[package]]
@ -5936,7 +5929,6 @@ name = "visible_bounds"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"iced", "iced",
"once_cell",
] ]
[[package]] [[package]]
@ -6290,7 +6282,6 @@ version = "1.0.0"
dependencies = [ dependencies = [
"async-tungstenite", "async-tungstenite",
"iced", "iced",
"once_cell",
"tokio", "tokio",
"warp", "warp",
] ]

View file

@ -162,7 +162,6 @@ log = "0.4"
lyon = "1.0" lyon = "1.0"
lyon_path = "1.0" lyon_path = "1.0"
num-traits = "0.2" num-traits = "0.2"
once_cell = "1.0"
ouroboros = "0.18" ouroboros = "0.18"
palette = "0.7" palette = "0.7"
png = "0.17" png = "0.17"

View file

@ -23,7 +23,6 @@ bytes.workspace = true
glam.workspace = true glam.workspace = true
log.workspace = true log.workspace = true
num-traits.workspace = true num-traits.workspace = true
once_cell.workspace = true
palette.workspace = true palette.workspace = true
rustc-hash.workspace = true rustc-hash.workspace = true
smol_str.workspace = true smol_str.workspace = true

View file

@ -166,10 +166,10 @@ impl Default for Theme {
fn default() -> Self { fn default() -> Self {
#[cfg(feature = "auto-detect-theme")] #[cfg(feature = "auto-detect-theme")]
{ {
use once_cell::sync::Lazy; use std::sync::LazyLock;
static DEFAULT: Lazy<Theme> = static DEFAULT: LazyLock<Theme> =
Lazy::new(|| match dark_light::detect() { LazyLock::new(|| match dark_light::detect() {
dark_light::Mode::Dark => Theme::Dark, dark_light::Mode::Dark => Theme::Dark,
dark_light::Mode::Light | dark_light::Mode::Default => { dark_light::Mode::Light | dark_light::Mode::Default => {
Theme::Light Theme::Light

View file

@ -1,7 +1,8 @@
//! Define the colors of a theme. //! Define the colors of a theme.
use std::sync::LazyLock;
use crate::{color, Color}; use crate::{color, Color};
use once_cell::sync::Lazy;
use palette::color_difference::Wcag21RelativeContrast; use palette::color_difference::Wcag21RelativeContrast;
use palette::rgb::Rgb; use palette::rgb::Rgb;
use palette::{FromColor, Hsl, Mix}; use palette::{FromColor, Hsl, Mix};
@ -341,92 +342,92 @@ pub struct Extended {
} }
/// The built-in light variant of an [`Extended`] palette. /// The built-in light variant of an [`Extended`] palette.
pub static EXTENDED_LIGHT: Lazy<Extended> = pub static EXTENDED_LIGHT: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::LIGHT)); LazyLock::new(|| Extended::generate(Palette::LIGHT));
/// The built-in dark variant of an [`Extended`] palette. /// The built-in dark variant of an [`Extended`] palette.
pub static EXTENDED_DARK: Lazy<Extended> = pub static EXTENDED_DARK: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::DARK)); LazyLock::new(|| Extended::generate(Palette::DARK));
/// The built-in Dracula variant of an [`Extended`] palette. /// The built-in Dracula variant of an [`Extended`] palette.
pub static EXTENDED_DRACULA: Lazy<Extended> = pub static EXTENDED_DRACULA: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::DRACULA)); LazyLock::new(|| Extended::generate(Palette::DRACULA));
/// The built-in Nord variant of an [`Extended`] palette. /// The built-in Nord variant of an [`Extended`] palette.
pub static EXTENDED_NORD: Lazy<Extended> = pub static EXTENDED_NORD: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::NORD)); LazyLock::new(|| Extended::generate(Palette::NORD));
/// The built-in Solarized Light variant of an [`Extended`] palette. /// The built-in Solarized Light variant of an [`Extended`] palette.
pub static EXTENDED_SOLARIZED_LIGHT: Lazy<Extended> = pub static EXTENDED_SOLARIZED_LIGHT: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::SOLARIZED_LIGHT)); LazyLock::new(|| Extended::generate(Palette::SOLARIZED_LIGHT));
/// The built-in Solarized Dark variant of an [`Extended`] palette. /// The built-in Solarized Dark variant of an [`Extended`] palette.
pub static EXTENDED_SOLARIZED_DARK: Lazy<Extended> = pub static EXTENDED_SOLARIZED_DARK: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::SOLARIZED_DARK)); LazyLock::new(|| Extended::generate(Palette::SOLARIZED_DARK));
/// The built-in Gruvbox Light variant of an [`Extended`] palette. /// The built-in Gruvbox Light variant of an [`Extended`] palette.
pub static EXTENDED_GRUVBOX_LIGHT: Lazy<Extended> = pub static EXTENDED_GRUVBOX_LIGHT: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::GRUVBOX_LIGHT)); LazyLock::new(|| Extended::generate(Palette::GRUVBOX_LIGHT));
/// The built-in Gruvbox Dark variant of an [`Extended`] palette. /// The built-in Gruvbox Dark variant of an [`Extended`] palette.
pub static EXTENDED_GRUVBOX_DARK: Lazy<Extended> = pub static EXTENDED_GRUVBOX_DARK: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::GRUVBOX_DARK)); LazyLock::new(|| Extended::generate(Palette::GRUVBOX_DARK));
/// The built-in Catppuccin Latte variant of an [`Extended`] palette. /// The built-in Catppuccin Latte variant of an [`Extended`] palette.
pub static EXTENDED_CATPPUCCIN_LATTE: Lazy<Extended> = pub static EXTENDED_CATPPUCCIN_LATTE: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::CATPPUCCIN_LATTE)); LazyLock::new(|| Extended::generate(Palette::CATPPUCCIN_LATTE));
/// The built-in Catppuccin Frappé variant of an [`Extended`] palette. /// The built-in Catppuccin Frappé variant of an [`Extended`] palette.
pub static EXTENDED_CATPPUCCIN_FRAPPE: Lazy<Extended> = pub static EXTENDED_CATPPUCCIN_FRAPPE: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::CATPPUCCIN_FRAPPE)); LazyLock::new(|| Extended::generate(Palette::CATPPUCCIN_FRAPPE));
/// The built-in Catppuccin Macchiato variant of an [`Extended`] palette. /// The built-in Catppuccin Macchiato variant of an [`Extended`] palette.
pub static EXTENDED_CATPPUCCIN_MACCHIATO: Lazy<Extended> = pub static EXTENDED_CATPPUCCIN_MACCHIATO: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::CATPPUCCIN_MACCHIATO)); LazyLock::new(|| Extended::generate(Palette::CATPPUCCIN_MACCHIATO));
/// The built-in Catppuccin Mocha variant of an [`Extended`] palette. /// The built-in Catppuccin Mocha variant of an [`Extended`] palette.
pub static EXTENDED_CATPPUCCIN_MOCHA: Lazy<Extended> = pub static EXTENDED_CATPPUCCIN_MOCHA: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::CATPPUCCIN_MOCHA)); LazyLock::new(|| Extended::generate(Palette::CATPPUCCIN_MOCHA));
/// The built-in Tokyo Night variant of an [`Extended`] palette. /// The built-in Tokyo Night variant of an [`Extended`] palette.
pub static EXTENDED_TOKYO_NIGHT: Lazy<Extended> = pub static EXTENDED_TOKYO_NIGHT: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::TOKYO_NIGHT)); LazyLock::new(|| Extended::generate(Palette::TOKYO_NIGHT));
/// The built-in Tokyo Night Storm variant of an [`Extended`] palette. /// The built-in Tokyo Night Storm variant of an [`Extended`] palette.
pub static EXTENDED_TOKYO_NIGHT_STORM: Lazy<Extended> = pub static EXTENDED_TOKYO_NIGHT_STORM: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::TOKYO_NIGHT_STORM)); LazyLock::new(|| Extended::generate(Palette::TOKYO_NIGHT_STORM));
/// The built-in Tokyo Night variant of an [`Extended`] palette. /// The built-in Tokyo Night variant of an [`Extended`] palette.
pub static EXTENDED_TOKYO_NIGHT_LIGHT: Lazy<Extended> = pub static EXTENDED_TOKYO_NIGHT_LIGHT: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::TOKYO_NIGHT_LIGHT)); LazyLock::new(|| Extended::generate(Palette::TOKYO_NIGHT_LIGHT));
/// The built-in Kanagawa Wave variant of an [`Extended`] palette. /// The built-in Kanagawa Wave variant of an [`Extended`] palette.
pub static EXTENDED_KANAGAWA_WAVE: Lazy<Extended> = pub static EXTENDED_KANAGAWA_WAVE: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::KANAGAWA_WAVE)); LazyLock::new(|| Extended::generate(Palette::KANAGAWA_WAVE));
/// The built-in Kanagawa Dragon variant of an [`Extended`] palette. /// The built-in Kanagawa Dragon variant of an [`Extended`] palette.
pub static EXTENDED_KANAGAWA_DRAGON: Lazy<Extended> = pub static EXTENDED_KANAGAWA_DRAGON: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::KANAGAWA_DRAGON)); LazyLock::new(|| Extended::generate(Palette::KANAGAWA_DRAGON));
/// The built-in Kanagawa Lotus variant of an [`Extended`] palette. /// The built-in Kanagawa Lotus variant of an [`Extended`] palette.
pub static EXTENDED_KANAGAWA_LOTUS: Lazy<Extended> = pub static EXTENDED_KANAGAWA_LOTUS: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::KANAGAWA_LOTUS)); LazyLock::new(|| Extended::generate(Palette::KANAGAWA_LOTUS));
/// The built-in Moonfly variant of an [`Extended`] palette. /// The built-in Moonfly variant of an [`Extended`] palette.
pub static EXTENDED_MOONFLY: Lazy<Extended> = pub static EXTENDED_MOONFLY: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::MOONFLY)); LazyLock::new(|| Extended::generate(Palette::MOONFLY));
/// The built-in Nightfly variant of an [`Extended`] palette. /// The built-in Nightfly variant of an [`Extended`] palette.
pub static EXTENDED_NIGHTFLY: Lazy<Extended> = pub static EXTENDED_NIGHTFLY: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::NIGHTFLY)); LazyLock::new(|| Extended::generate(Palette::NIGHTFLY));
/// The built-in Oxocarbon variant of an [`Extended`] palette. /// The built-in Oxocarbon variant of an [`Extended`] palette.
pub static EXTENDED_OXOCARBON: Lazy<Extended> = pub static EXTENDED_OXOCARBON: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::OXOCARBON)); LazyLock::new(|| Extended::generate(Palette::OXOCARBON));
/// The built-in Ferra variant of an [`Extended`] palette. /// The built-in Ferra variant of an [`Extended`] palette.
pub static EXTENDED_FERRA: Lazy<Extended> = pub static EXTENDED_FERRA: LazyLock<Extended> =
Lazy::new(|| Extended::generate(Palette::FERRA)); LazyLock::new(|| Extended::generate(Palette::FERRA));
impl Extended { impl Extended {
/// Generates an [`Extended`] palette from a simple [`Palette`]. /// Generates an [`Extended`] palette from a simple [`Palette`].

View file

@ -10,4 +10,3 @@ iced.workspace = true
iced.features = ["advanced", "canvas"] iced.features = ["advanced", "canvas"]
lyon_algorithms = "1.0" lyon_algorithms = "1.0"
once_cell.workspace = true

View file

@ -1,41 +1,42 @@
use std::sync::LazyLock;
use iced::Point; use iced::Point;
use lyon_algorithms::measure::PathMeasurements; use lyon_algorithms::measure::PathMeasurements;
use lyon_algorithms::path::{builder::NoAttributes, path::BuilderImpl, Path}; use lyon_algorithms::path::{builder::NoAttributes, path::BuilderImpl, Path};
use once_cell::sync::Lazy;
pub static EMPHASIZED: Lazy<Easing> = Lazy::new(|| { pub static EMPHASIZED: LazyLock<Easing> = LazyLock::new(|| {
Easing::builder() Easing::builder()
.cubic_bezier_to([0.05, 0.0], [0.133333, 0.06], [0.166666, 0.4]) .cubic_bezier_to([0.05, 0.0], [0.133333, 0.06], [0.166666, 0.4])
.cubic_bezier_to([0.208333, 0.82], [0.25, 1.0], [1.0, 1.0]) .cubic_bezier_to([0.208333, 0.82], [0.25, 1.0], [1.0, 1.0])
.build() .build()
}); });
pub static EMPHASIZED_DECELERATE: Lazy<Easing> = Lazy::new(|| { pub static EMPHASIZED_DECELERATE: LazyLock<Easing> = LazyLock::new(|| {
Easing::builder() Easing::builder()
.cubic_bezier_to([0.05, 0.7], [0.1, 1.0], [1.0, 1.0]) .cubic_bezier_to([0.05, 0.7], [0.1, 1.0], [1.0, 1.0])
.build() .build()
}); });
pub static EMPHASIZED_ACCELERATE: Lazy<Easing> = Lazy::new(|| { pub static EMPHASIZED_ACCELERATE: LazyLock<Easing> = LazyLock::new(|| {
Easing::builder() Easing::builder()
.cubic_bezier_to([0.3, 0.0], [0.8, 0.15], [1.0, 1.0]) .cubic_bezier_to([0.3, 0.0], [0.8, 0.15], [1.0, 1.0])
.build() .build()
}); });
pub static STANDARD: Lazy<Easing> = Lazy::new(|| { pub static STANDARD: LazyLock<Easing> = LazyLock::new(|| {
Easing::builder() Easing::builder()
.cubic_bezier_to([0.2, 0.0], [0.0, 1.0], [1.0, 1.0]) .cubic_bezier_to([0.2, 0.0], [0.0, 1.0], [1.0, 1.0])
.build() .build()
}); });
pub static STANDARD_DECELERATE: Lazy<Easing> = Lazy::new(|| { pub static STANDARD_DECELERATE: LazyLock<Easing> = LazyLock::new(|| {
Easing::builder() Easing::builder()
.cubic_bezier_to([0.0, 0.0], [0.0, 1.0], [1.0, 1.0]) .cubic_bezier_to([0.0, 0.0], [0.0, 1.0], [1.0, 1.0])
.build() .build()
}); });
pub static STANDARD_ACCELERATE: Lazy<Easing> = Lazy::new(|| { pub static STANDARD_ACCELERATE: LazyLock<Easing> = LazyLock::new(|| {
Easing::builder() Easing::builder()
.cubic_bezier_to([0.3, 0.0], [1.0, 1.0], [1.0, 1.0]) .cubic_bezier_to([0.3, 0.0], [1.0, 1.0], [1.0, 1.0])
.build() .build()

View file

@ -8,5 +8,3 @@ publish = false
[dependencies] [dependencies]
iced.workspace = true iced.workspace = true
iced.features = ["debug"] iced.features = ["debug"]
once_cell.workspace = true

View file

@ -1,12 +1,13 @@
use std::sync::LazyLock;
use iced::widget::{ use iced::widget::{
button, column, container, horizontal_space, progress_bar, radio, row, button, column, container, horizontal_space, progress_bar, radio, row,
scrollable, slider, text, vertical_space, scrollable, slider, text, vertical_space,
}; };
use iced::{Border, Center, Color, Element, Fill, Task, Theme}; use iced::{Border, Center, Color, Element, Fill, Task, Theme};
use once_cell::sync::Lazy; static SCROLLABLE_ID: LazyLock<scrollable::Id> =
LazyLock::new(scrollable::Id::unique);
static SCROLLABLE_ID: Lazy<scrollable::Id> = Lazy::new(scrollable::Id::unique);
pub fn main() -> iced::Result { pub fn main() -> iced::Result {
iced::application( iced::application(

View file

@ -8,5 +8,3 @@ publish = false
[dependencies] [dependencies]
iced.workspace = true iced.workspace = true
iced.features = ["debug"] iced.features = ["debug"]
once_cell.workspace = true

View file

@ -157,9 +157,9 @@ impl Example {
} }
} }
use once_cell::sync::Lazy; use std::sync::LazyLock;
static OUTER_CONTAINER: Lazy<container::Id> = static OUTER_CONTAINER: LazyLock<container::Id> =
Lazy::new(|| container::Id::new("outer")); LazyLock::new(|| container::Id::new("outer"));
static INNER_CONTAINER: Lazy<container::Id> = static INNER_CONTAINER: LazyLock<container::Id> =
Lazy::new(|| container::Id::new("inner")); LazyLock::new(|| container::Id::new("inner"));

View file

@ -9,7 +9,6 @@ publish = false
iced.workspace = true iced.workspace = true
iced.features = ["debug", "tokio"] iced.features = ["debug", "tokio"]
once_cell.workspace = true
warp = "0.3" warp = "0.3"
[dependencies.async-tungstenite] [dependencies.async-tungstenite]

View file

@ -1,10 +1,11 @@
mod echo; mod echo;
use std::sync::LazyLock;
use iced::widget::{ use iced::widget::{
self, button, center, column, row, scrollable, text, text_input, self, button, center, column, row, scrollable, text, text_input,
}; };
use iced::{color, Center, Element, Fill, Subscription, Task}; use iced::{color, Center, Element, Fill, Subscription, Task};
use once_cell::sync::Lazy;
pub fn main() -> iced::Result { pub fn main() -> iced::Result {
iced::application("WebSocket - Iced", WebSocket::update, WebSocket::view) iced::application("WebSocket - Iced", WebSocket::update, WebSocket::view)
@ -138,4 +139,5 @@ enum State {
Connected(echo::Connection), Connected(echo::Connection),
} }
static MESSAGE_LOG: Lazy<scrollable::Id> = Lazy::new(scrollable::Id::unique); static MESSAGE_LOG: LazyLock<scrollable::Id> =
LazyLock::new(scrollable::Id::unique);

View file

@ -33,7 +33,6 @@ bytemuck.workspace = true
cosmic-text.workspace = true cosmic-text.workspace = true
half.workspace = true half.workspace = true
log.workspace = true log.workspace = true
once_cell.workspace = true
raw-window-handle.workspace = true raw-window-handle.workspace = true
rustc-hash.workspace = true rustc-hash.workspace = true
thiserror.workspace = true thiserror.workspace = true

View file

@ -14,10 +14,9 @@ use crate::core::font::{self, Font};
use crate::core::text::{Shaping, Wrapping}; use crate::core::text::{Shaping, Wrapping};
use crate::core::{Color, Pixels, Point, Rectangle, Size, Transformation}; use crate::core::{Color, Pixels, Point, Rectangle, Size, Transformation};
use once_cell::sync::OnceCell;
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::HashSet; use std::collections::HashSet;
use std::sync::{Arc, RwLock, Weak}; use std::sync::{Arc, OnceLock, RwLock, Weak};
/// A text primitive. /// A text primitive.
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
@ -157,7 +156,7 @@ pub const FIRA_SANS_REGULAR: &[u8] =
/// Returns the global [`FontSystem`]. /// Returns the global [`FontSystem`].
pub fn font_system() -> &'static RwLock<FontSystem> { pub fn font_system() -> &'static RwLock<FontSystem> {
static FONT_SYSTEM: OnceCell<RwLock<FontSystem>> = OnceCell::new(); static FONT_SYSTEM: OnceLock<RwLock<FontSystem>> = OnceLock::new();
FONT_SYSTEM.get_or_init(|| { FONT_SYSTEM.get_or_init(|| {
RwLock::new(FontSystem { RwLock::new(FontSystem {

View file

@ -16,5 +16,4 @@ workspace = true
[dependencies] [dependencies]
iced_core.workspace = true iced_core.workspace = true
once_cell.workspace = true
syntect.workspace = true syntect.workspace = true

View file

@ -5,16 +5,16 @@ use crate::core::font::{self, Font};
use crate::core::text::highlighter::{self, Format}; use crate::core::text::highlighter::{self, Format};
use crate::core::Color; use crate::core::Color;
use once_cell::sync::Lazy;
use std::ops::Range; use std::ops::Range;
use std::sync::LazyLock;
use syntect::highlighting; use syntect::highlighting;
use syntect::parsing; use syntect::parsing;
static SYNTAXES: Lazy<parsing::SyntaxSet> = static SYNTAXES: LazyLock<parsing::SyntaxSet> =
Lazy::new(parsing::SyntaxSet::load_defaults_nonewlines); LazyLock::new(parsing::SyntaxSet::load_defaults_nonewlines);
static THEMES: Lazy<highlighting::ThemeSet> = static THEMES: LazyLock<highlighting::ThemeSet> =
Lazy::new(highlighting::ThemeSet::load_defaults); LazyLock::new(highlighting::ThemeSet::load_defaults);
const LINES_PER_SNAPSHOT: usize = 50; const LINES_PER_SNAPSHOT: usize = 50;

View file

@ -35,7 +35,6 @@ glam.workspace = true
glyphon.workspace = true glyphon.workspace = true
guillotiere.workspace = true guillotiere.workspace = true
log.workspace = true log.workspace = true
once_cell.workspace = true
rustc-hash.workspace = true rustc-hash.workspace = true
thiserror.workspace = true thiserror.workspace = true
wgpu.workspace = true wgpu.workspace = true

View file

@ -33,7 +33,6 @@ iced_renderer.workspace = true
iced_runtime.workspace = true iced_runtime.workspace = true
num-traits.workspace = true num-traits.workspace = true
once_cell.workspace = true
rustc-hash.workspace = true rustc-hash.workspace = true
thiserror.workspace = true thiserror.workspace = true
unicode-segmentation.workspace = true unicode-segmentation.workspace = true

View file

@ -1706,11 +1706,12 @@ where
+ 'a, + 'a,
Theme: text::Catalog + crate::svg::Catalog + 'a, Theme: text::Catalog + crate::svg::Catalog + 'a,
{ {
use std::sync::LazyLock;
use crate::core::{Alignment, Font}; use crate::core::{Alignment, Font};
use crate::svg; use crate::svg;
use once_cell::sync::Lazy;
static LOGO: Lazy<svg::Handle> = Lazy::new(|| { static LOGO: LazyLock<svg::Handle> = LazyLock::new(|| {
svg::Handle::from_memory(include_bytes!("../assets/iced-logo.svg")) svg::Handle::from_memory(include_bytes!("../assets/iced-logo.svg"))
}); });