aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/examples
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-11-27 10:26:40 +0000
committermat <git@matdoes.dev>2024-11-27 10:26:40 +0000
commit0817382098128adcecb77756a3c7cd1bd0066057 (patch)
tree623d9b297f9b5fdb2af74ab3c5a4fa5c1b72ff5b /azalea-protocol/examples
parentdfdc3144b61b6750ad62fb493b7c00c6c820c90b (diff)
downloadazalea-drasl-0817382098128adcecb77756a3c7cd1bd0066057.tar.xz
replace once_cell with std:;sync::LazyLock
Diffstat (limited to 'azalea-protocol/examples')
-rw-r--r--azalea-protocol/examples/handshake_proxy.rs7
1 files changed, 3 insertions, 4 deletions
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,<data>"
-static PROXY_FAVICON: Lazy<Option<String>> = Lazy::new(|| None);
+static PROXY_FAVICON: LazyLock<Option<String>> = LazyLock::new(|| None);
-static PROXY_VERSION: Lazy<Version> = Lazy::new(|| Version {
+static PROXY_VERSION: LazyLock<Version> = LazyLock::new(|| Version {
name: "1.19.3".to_string(),
protocol: PROTOCOL_VERSION,
});