From 0817382098128adcecb77756a3c7cd1bd0066057 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 27 Nov 2024 10:26:40 +0000 Subject: replace once_cell with std:;sync::LazyLock --- azalea-protocol/examples/handshake_proxy.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'azalea-protocol/examples') diff --git a/azalea-protocol/examples/handshake_proxy.rs b/azalea-protocol/examples/handshake_proxy.rs index 8e675c58..14e5115e 100644 --- a/azalea-protocol/examples/handshake_proxy.rs +++ b/azalea-protocol/examples/handshake_proxy.rs @@ -1,7 +1,7 @@ //! A "simple" server that gets login information and proxies connections. //! After login all connections are encrypted and Azalea cannot read them. -use std::error::Error; +use std::{error::Error, sync::LazyLock}; use azalea_protocol::{ connect::Connection, @@ -23,7 +23,6 @@ use azalea_protocol::{ read::ReadPacketError, }; use futures::FutureExt; -use once_cell::sync::Lazy; use tokio::{ io::{self, AsyncWriteExt}, net::{TcpListener, TcpStream}, @@ -37,9 +36,9 @@ const PROXY_ADDR: &str = "127.0.0.1:25565"; const PROXY_DESC: &str = "An Azalea Minecraft Proxy"; // String must be formatted like "data:image/png;base64," -static PROXY_FAVICON: Lazy> = Lazy::new(|| None); +static PROXY_FAVICON: LazyLock> = LazyLock::new(|| None); -static PROXY_VERSION: Lazy = Lazy::new(|| Version { +static PROXY_VERSION: LazyLock = LazyLock::new(|| Version { name: "1.19.3".to_string(), protocol: PROTOCOL_VERSION, }); -- cgit v1.2.3