From 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 22 Feb 2025 23:01:54 +0000 Subject: update to rust edition 2024 --- azalea-protocol/src/connect.rs | 6 +++--- azalea-protocol/src/lib.rs | 8 +++++--- azalea-protocol/src/resolver.rs | 2 +- azalea-protocol/src/write.rs | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) (limited to 'azalea-protocol/src') diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs index 0f8bc912..6ac14e0b 100755 --- a/azalea-protocol/src/connect.rs +++ b/azalea-protocol/src/connect.rs @@ -10,19 +10,19 @@ use azalea_auth::sessionserver::{ClientSessionServerError, ServerSessionServerEr use azalea_crypto::{Aes128CfbDec, Aes128CfbEnc}; use thiserror::Error; use tokio::io::{AsyncWriteExt, BufStream}; -use tokio::net::tcp::{OwnedReadHalf, OwnedWriteHalf, ReuniteError}; use tokio::net::TcpStream; +use tokio::net::tcp::{OwnedReadHalf, OwnedWriteHalf, ReuniteError}; use tracing::{error, info}; use uuid::Uuid; +use crate::packets::ProtocolPacket; use crate::packets::config::{ClientboundConfigPacket, ServerboundConfigPacket}; use crate::packets::game::{ClientboundGamePacket, ServerboundGamePacket}; use crate::packets::handshake::{ClientboundHandshakePacket, ServerboundHandshakePacket}; use crate::packets::login::c_hello::ClientboundHello; use crate::packets::login::{ClientboundLoginPacket, ServerboundLoginPacket}; use crate::packets::status::{ClientboundStatusPacket, ServerboundStatusPacket}; -use crate::packets::ProtocolPacket; -use crate::read::{deserialize_packet, read_raw_packet, try_read_raw_packet, ReadPacketError}; +use crate::read::{ReadPacketError, deserialize_packet, read_raw_packet, try_read_raw_packet}; use crate::write::{serialize_packet, write_raw_packet}; pub struct RawReadConnection { diff --git a/azalea-protocol/src/lib.rs b/azalea-protocol/src/lib.rs index 12243de6..f9d29785 100644 --- a/azalea-protocol/src/lib.rs +++ b/azalea-protocol/src/lib.rs @@ -115,9 +115,9 @@ mod tests { use crate::{ packets::{ - game::s_chat::{LastSeenMessagesUpdate, ServerboundChat}, - login::{s_hello::ServerboundHello, ServerboundLoginPacket}, Packet, + game::s_chat::{LastSeenMessagesUpdate, ServerboundChat}, + login::{ServerboundLoginPacket, s_hello::ServerboundHello}, }, read::{compression_decoder, read_packet}, write::{compression_encoder, serialize_packet, write_packet}, @@ -136,7 +136,9 @@ mod tests { assert_eq!( stream, - [22, 0, 4, 116, 101, 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + [ + 22, 0, 4, 116, 101, 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ] ); let mut stream = Cursor::new(stream); diff --git a/azalea-protocol/src/resolver.rs b/azalea-protocol/src/resolver.rs index a21d5d9b..63b66be3 100755 --- a/azalea-protocol/src/resolver.rs +++ b/azalea-protocol/src/resolver.rs @@ -4,8 +4,8 @@ use std::net::{IpAddr, SocketAddr}; use async_recursion::async_recursion; use hickory_resolver::{ - config::{ResolverConfig, ResolverOpts}, Name, TokioAsyncResolver, + config::{ResolverConfig, ResolverOpts}, }; use thiserror::Error; diff --git a/azalea-protocol/src/write.rs b/azalea-protocol/src/write.rs index f1ffd82e..adefc340 100755 --- a/azalea-protocol/src/write.rs +++ b/azalea-protocol/src/write.rs @@ -7,7 +7,7 @@ use std::{ use azalea_buf::AzaleaWriteVar; use azalea_crypto::Aes128CfbEnc; -use flate2::{bufread::ZlibEncoder, Compression}; +use flate2::{Compression, bufread::ZlibEncoder}; use thiserror::Error; use tokio::io::{AsyncWrite, AsyncWriteExt}; use tracing::trace; -- cgit v1.2.3