diff options
| author | mat <git@matdoes.dev> | 2024-11-27 10:26:40 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-11-27 10:26:40 +0000 |
| commit | 0817382098128adcecb77756a3c7cd1bd0066057 (patch) | |
| tree | 623d9b297f9b5fdb2af74ab3c5a4fa5c1b72ff5b /azalea-protocol | |
| parent | dfdc3144b61b6750ad62fb493b7c00c6c820c90b (diff) | |
| download | azalea-drasl-0817382098128adcecb77756a3c7cd1bd0066057.tar.xz | |
replace once_cell with std:;sync::LazyLock
Diffstat (limited to 'azalea-protocol')
| -rw-r--r-- | azalea-protocol/Cargo.toml | 14 | ||||
| -rw-r--r-- | azalea-protocol/examples/handshake_proxy.rs | 7 |
2 files changed, 13 insertions, 8 deletions
diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index 1e32d71d..4ed5081b 100644 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -12,10 +12,17 @@ version = "0.10.3+mc1.21.1" async-recursion = { workspace = true } azalea-auth = { path = "../azalea-auth", version = "0.10.0" } azalea-block = { path = "../azalea-block", default-features = false, version = "0.10.0" } -azalea-brigadier = { path = "../azalea-brigadier", version = "0.10.0", features = ["azalea-buf"] } +azalea-brigadier = { path = "../azalea-brigadier", version = "0.10.0", features = [ + "azalea-buf", +] } azalea-buf = { path = "../azalea-buf", version = "0.10.0" } -azalea-chat = { path = "../azalea-chat", version = "0.10.0", features = ["numbers", "azalea-buf"] } -azalea-core = { path = "../azalea-core", optional = true, version = "0.10.0", features = ["serde"] } +azalea-chat = { path = "../azalea-chat", version = "0.10.0", features = [ + "numbers", + "azalea-buf", +] } +azalea-core = { path = "../azalea-core", optional = true, version = "0.10.0", features = [ + "serde", +] } azalea-crypto = { path = "../azalea-crypto", version = "0.10.0" } azalea-entity = { version = "0.10.0", path = "../azalea-entity" } azalea-inventory = { version = "0.10.0", path = "../azalea-inventory" } @@ -48,6 +55,5 @@ packets = ["connecting", "dep:azalea-core"] [dev-dependencies] anyhow = { workspace = true } -once_cell = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } 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, }); |
