Use once_cell instead of lazy_static
This seems to be generally considered the preferred, idiomatic solution now. This is in the standard library behind a feature flag (apparently now called `std::sync::LazyLock`).
This commit is contained in:
parent
82217947aa
commit
be9cd3a09f
6 changed files with 13 additions and 17 deletions
|
|
@ -8,6 +8,7 @@ use iced::widget::{
|
|||
use iced::{
|
||||
Application, Color, Command, Element, Length, Settings, Subscription, Theme,
|
||||
};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
WebSocket::run(Settings::default())
|
||||
|
|
@ -165,6 +166,4 @@ impl Default for State {
|
|||
}
|
||||
}
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref MESSAGE_LOG: scrollable::Id = scrollable::Id::unique();
|
||||
}
|
||||
static MESSAGE_LOG: Lazy<scrollable::Id> = Lazy::new(scrollable::Id::unique);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue