diff options
| author | mat <git@matdoes.dev> | 2025-02-22 23:01:54 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-02-22 23:01:54 +0000 |
| commit | 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (patch) | |
| tree | 7920fec1203e8e96463a142f5f6da6164e76e684 /azalea-protocol | |
| parent | bdd2fc91e11e2896d8e1c7046df247e1075bd40d (diff) | |
| download | azalea-drasl-34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6.tar.xz | |
update to rust edition 2024
Diffstat (limited to 'azalea-protocol')
| -rwxr-xr-x | azalea-protocol/azalea-protocol-macros/src/lib.rs | 4 | ||||
| -rw-r--r-- | azalea-protocol/examples/handshake_proxy.rs | 10 | ||||
| -rwxr-xr-x | azalea-protocol/src/connect.rs | 6 | ||||
| -rw-r--r-- | azalea-protocol/src/lib.rs | 8 | ||||
| -rwxr-xr-x | azalea-protocol/src/resolver.rs | 2 | ||||
| -rwxr-xr-x | azalea-protocol/src/write.rs | 2 |
6 files changed, 17 insertions, 15 deletions
diff --git a/azalea-protocol/azalea-protocol-macros/src/lib.rs b/azalea-protocol/azalea-protocol-macros/src/lib.rs index 5cbf2925..a33d21e0 100755 --- a/azalea-protocol/azalea-protocol-macros/src/lib.rs +++ b/azalea-protocol/azalea-protocol-macros/src/lib.rs @@ -1,9 +1,9 @@ use proc_macro::TokenStream; use quote::quote; use syn::{ - bracketed, + DeriveInput, Ident, Token, bracketed, parse::{Parse, ParseStream, Result}, - parse_macro_input, DeriveInput, Ident, Token, + parse_macro_input, }; fn as_packet_derive(input: TokenStream, state: proc_macro2::TokenStream) -> TokenStream { diff --git a/azalea-protocol/examples/handshake_proxy.rs b/azalea-protocol/examples/handshake_proxy.rs index f50300d0..0161258a 100644 --- a/azalea-protocol/examples/handshake_proxy.rs +++ b/azalea-protocol/examples/handshake_proxy.rs @@ -6,17 +6,17 @@ use std::{error::Error, sync::LazyLock}; use azalea_protocol::{ connect::Connection, packets::{ + ClientIntention, PROTOCOL_VERSION, VERSION_NAME, handshake::{ - s_intention::ServerboundIntention, ClientboundHandshakePacket, - ServerboundHandshakePacket, + ClientboundHandshakePacket, ServerboundHandshakePacket, + s_intention::ServerboundIntention, }, - login::{s_hello::ServerboundHello, ServerboundLoginPacket}, + login::{ServerboundLoginPacket, s_hello::ServerboundHello}, status::{ + ServerboundStatusPacket, c_pong_response::ClientboundPongResponse, c_status_response::{ClientboundStatusResponse, Players, Version}, - ServerboundStatusPacket, }, - ClientIntention, PROTOCOL_VERSION, VERSION_NAME, }, read::ReadPacketError, }; 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; |
