chore: remove once_cell dependency
This commit is contained in:
parent
b156087fcf
commit
0e8c3fe30f
20 changed files with 80 additions and 96 deletions
|
|
@ -10,4 +10,3 @@ iced.workspace = true
|
|||
iced.features = ["advanced", "canvas"]
|
||||
|
||||
lyon_algorithms = "1.0"
|
||||
once_cell.workspace = true
|
||||
|
|
@ -1,41 +1,42 @@
|
|||
use std::sync::LazyLock;
|
||||
|
||||
use iced::Point;
|
||||
|
||||
use lyon_algorithms::measure::PathMeasurements;
|
||||
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()
|
||||
.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])
|
||||
.build()
|
||||
});
|
||||
|
||||
pub static EMPHASIZED_DECELERATE: Lazy<Easing> = Lazy::new(|| {
|
||||
pub static EMPHASIZED_DECELERATE: LazyLock<Easing> = LazyLock::new(|| {
|
||||
Easing::builder()
|
||||
.cubic_bezier_to([0.05, 0.7], [0.1, 1.0], [1.0, 1.0])
|
||||
.build()
|
||||
});
|
||||
|
||||
pub static EMPHASIZED_ACCELERATE: Lazy<Easing> = Lazy::new(|| {
|
||||
pub static EMPHASIZED_ACCELERATE: LazyLock<Easing> = LazyLock::new(|| {
|
||||
Easing::builder()
|
||||
.cubic_bezier_to([0.3, 0.0], [0.8, 0.15], [1.0, 1.0])
|
||||
.build()
|
||||
});
|
||||
|
||||
pub static STANDARD: Lazy<Easing> = Lazy::new(|| {
|
||||
pub static STANDARD: LazyLock<Easing> = LazyLock::new(|| {
|
||||
Easing::builder()
|
||||
.cubic_bezier_to([0.2, 0.0], [0.0, 1.0], [1.0, 1.0])
|
||||
.build()
|
||||
});
|
||||
|
||||
pub static STANDARD_DECELERATE: Lazy<Easing> = Lazy::new(|| {
|
||||
pub static STANDARD_DECELERATE: LazyLock<Easing> = LazyLock::new(|| {
|
||||
Easing::builder()
|
||||
.cubic_bezier_to([0.0, 0.0], [0.0, 1.0], [1.0, 1.0])
|
||||
.build()
|
||||
});
|
||||
|
||||
pub static STANDARD_ACCELERATE: Lazy<Easing> = Lazy::new(|| {
|
||||
pub static STANDARD_ACCELERATE: LazyLock<Easing> = LazyLock::new(|| {
|
||||
Easing::builder()
|
||||
.cubic_bezier_to([0.3, 0.0], [1.0, 1.0], [1.0, 1.0])
|
||||
.build()
|
||||
|
|
|
|||
|
|
@ -8,5 +8,3 @@ publish = false
|
|||
[dependencies]
|
||||
iced.workspace = true
|
||||
iced.features = ["debug"]
|
||||
|
||||
once_cell.workspace = true
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
use std::sync::LazyLock;
|
||||
|
||||
use iced::widget::{
|
||||
button, column, container, horizontal_space, progress_bar, radio, row,
|
||||
scrollable, slider, text, vertical_space,
|
||||
};
|
||||
use iced::{Border, Center, Color, Element, Fill, Task, Theme};
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
static SCROLLABLE_ID: Lazy<scrollable::Id> = Lazy::new(scrollable::Id::unique);
|
||||
static SCROLLABLE_ID: LazyLock<scrollable::Id> =
|
||||
LazyLock::new(scrollable::Id::unique);
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
iced::application(
|
||||
|
|
|
|||
|
|
@ -8,5 +8,3 @@ publish = false
|
|||
[dependencies]
|
||||
iced.workspace = true
|
||||
iced.features = ["debug"]
|
||||
|
||||
once_cell.workspace = true
|
||||
|
|
|
|||
|
|
@ -157,9 +157,9 @@ impl Example {
|
|||
}
|
||||
}
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
static OUTER_CONTAINER: Lazy<container::Id> =
|
||||
Lazy::new(|| container::Id::new("outer"));
|
||||
static INNER_CONTAINER: Lazy<container::Id> =
|
||||
Lazy::new(|| container::Id::new("inner"));
|
||||
static OUTER_CONTAINER: LazyLock<container::Id> =
|
||||
LazyLock::new(|| container::Id::new("outer"));
|
||||
static INNER_CONTAINER: LazyLock<container::Id> =
|
||||
LazyLock::new(|| container::Id::new("inner"));
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ publish = false
|
|||
iced.workspace = true
|
||||
iced.features = ["debug", "tokio"]
|
||||
|
||||
once_cell.workspace = true
|
||||
warp = "0.3"
|
||||
|
||||
[dependencies.async-tungstenite]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
mod echo;
|
||||
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use iced::widget::{
|
||||
self, button, center, column, row, scrollable, text, text_input,
|
||||
};
|
||||
use iced::{color, Center, Element, Fill, Subscription, Task};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
iced::application("WebSocket - Iced", WebSocket::update, WebSocket::view)
|
||||
|
|
@ -138,4 +139,5 @@ enum State {
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue