From 59e89ddeb0628c5a610dabe8c2a20f7bad7fbce2 Mon Sep 17 00:00:00 2001 From: genusistimelord Date: Thu, 19 Sep 2024 10:37:58 -0400 Subject: [PATCH] remove once_cell in place of standard libraries LazyLock --- Cargo.lock | 5 ++--- Cargo.toml | 8 ++++---- src/core/date.rs | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c2a217fa..9741d0af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1411,9 +1411,9 @@ dependencies = [ [[package]] name = "iced" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44ccdb0d1a25ff7581e75991229857c353c87d79c199d375af37d264f6fbd06d" +checksum = "88acfabc84ec077eaf9ede3457ffa3a104626d79022a9bf7f296093b1d60c73f" dependencies = [ "iced_core", "iced_futures", @@ -1434,7 +1434,6 @@ dependencies = [ "itertools", "num-format", "num-traits", - "once_cell", "rand", "time", ] diff --git a/Cargo.toml b/Cargo.toml index 0dd82392..3fc10b44 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,16 +8,17 @@ authors = [ edition = "2021" description = "Additional widgets for the Iced GUI library" license = "MIT" +homepage = "https://iced.rs" repository = "https://github.com/iced-rs/iced_aw" -# TODO documentation readme = "README.md" keywords = ["gui", "graphics", "interface", "widgets", "iced"] categories = ["gui"] +rust-version = "1.80" [features] badge = [] card = [] -date_picker = ["chrono", "once_cell", "icons"] +date_picker = ["chrono", "icons"] color_picker = ["icons", "iced/canvas"] cupertino = ["time", "iced/canvas", "icons"] grid = ["itertools"] @@ -65,13 +66,12 @@ chrono = { version = "0.4.38", optional = true } itertools = { version = "0.13.0", optional = true } num-format = { version = "0.4.4", optional = true } num-traits = { version = "0.2.19", optional = true } -once_cell = { version = "1.19.0", optional = true } time = { version = "0.3.36", features = ["local-offset"], optional = true } [dependencies.iced] #git = "https://github.com/iced-rs/iced.git" #rev = "b474a2b7a763dcde6a377cb409001a7b5285ee8d" -version = "0.13.0" +version = "0.13.1" default-features = false features = ["advanced"] diff --git a/src/core/date.rs b/src/core/date.rs index db291701..92204fc4 100644 --- a/src/core/date.rs +++ b/src/core/date.rs @@ -1,8 +1,8 @@ //! Helper functions for calculating dates use chrono::{Datelike, Duration, Local, NaiveDate}; -use once_cell::sync::Lazy; use std::fmt::Display; +use std::sync::LazyLock; /// The date value #[derive(Clone, Copy, Debug)] @@ -221,7 +221,7 @@ pub fn date_as_string(date: NaiveDate) -> String { } /// Gets the length of the longest month name. -pub static MAX_MONTH_STR_LEN: Lazy = Lazy::new(|| { +pub static MAX_MONTH_STR_LEN: LazyLock = LazyLock::new(|| { let months = [ NaiveDate::from_ymd_opt(0, 1, 1).expect("Year, Month or Day doesnt Exist"), NaiveDate::from_ymd_opt(0, 2, 1).expect("Year, Month or Day doesnt Exist"), @@ -252,7 +252,7 @@ pub static MAX_MONTH_STR_LEN: Lazy = Lazy::new(|| { /// Gets the labels of the weekdays containing the first two characters of /// the weekdays. -pub static WEEKDAY_LABELS: Lazy> = Lazy::new(|| { +pub static WEEKDAY_LABELS: LazyLock> = LazyLock::new(|| { let days = [ // Monday NaiveDate::from_ymd_opt(2020, 6, 1).expect("Year, Month or Day doesnt Exist"),