summaryrefslogtreecommitdiffstats
path: root/examples/websocket/src
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 /examples/websocket/src
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 'examples/websocket/src')
-rw-r--r--examples/websocket/src/main.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/websocket/src/main.rs b/examples/websocket/src/main.rs
index 3902e04c..ff2929da 100644
--- a/examples/websocket/src/main.rs
+++ b/examples/websocket/src/main.rs
@@ -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);