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-buf | |
| parent | bdd2fc91e11e2896d8e1c7046df247e1075bd40d (diff) | |
| download | azalea-drasl-34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6.tar.xz | |
update to rust edition 2024
Diffstat (limited to 'azalea-buf')
| -rwxr-xr-x | azalea-buf/azalea-buf-macros/src/lib.rs | 2 | ||||
| -rw-r--r-- | azalea-buf/azalea-buf-macros/src/read.rs | 4 | ||||
| -rw-r--r-- | azalea-buf/azalea-buf-macros/src/write.rs | 4 | ||||
| -rwxr-xr-x | azalea-buf/src/read.rs | 8 | ||||
| -rwxr-xr-x | azalea-buf/src/serializable_uuid.rs | 2 | ||||
| -rwxr-xr-x | azalea-buf/src/write.rs | 2 |
6 files changed, 12 insertions, 10 deletions
diff --git a/azalea-buf/azalea-buf-macros/src/lib.rs b/azalea-buf/azalea-buf-macros/src/lib.rs index dec624e3..c4938f89 100755 --- a/azalea-buf/azalea-buf-macros/src/lib.rs +++ b/azalea-buf/azalea-buf-macros/src/lib.rs @@ -3,7 +3,7 @@ mod write; use proc_macro::TokenStream; use quote::quote; -use syn::{parse_macro_input, DeriveInput}; +use syn::{DeriveInput, parse_macro_input}; #[proc_macro_derive(AzaleaRead, attributes(var))] pub fn derive_azalearead(input: TokenStream) -> TokenStream { diff --git a/azalea-buf/azalea-buf-macros/src/read.rs b/azalea-buf/azalea-buf-macros/src/read.rs index c093d4a1..0500ec7c 100644 --- a/azalea-buf/azalea-buf-macros/src/read.rs +++ b/azalea-buf/azalea-buf-macros/src/read.rs @@ -1,5 +1,5 @@ -use quote::{quote, ToTokens}; -use syn::{punctuated::Punctuated, token::Comma, Data, Field, FieldsNamed, Ident}; +use quote::{ToTokens, quote}; +use syn::{Data, Field, FieldsNamed, Ident, punctuated::Punctuated, token::Comma}; fn read_named_fields( named: &Punctuated<Field, Comma>, diff --git a/azalea-buf/azalea-buf-macros/src/write.rs b/azalea-buf/azalea-buf-macros/src/write.rs index df461d59..de436e70 100644 --- a/azalea-buf/azalea-buf-macros/src/write.rs +++ b/azalea-buf/azalea-buf-macros/src/write.rs @@ -1,6 +1,6 @@ use proc_macro2::Span; -use quote::{quote, ToTokens}; -use syn::{punctuated::Punctuated, token::Comma, Data, Field, FieldsNamed, Ident}; +use quote::{ToTokens, quote}; +use syn::{Data, Field, FieldsNamed, Ident, punctuated::Punctuated, token::Comma}; fn write_named_fields( named: &Punctuated<Field, Comma>, diff --git a/azalea-buf/src/read.rs b/azalea-buf/src/read.rs index 71c96c34..e6f7aa51 100755 --- a/azalea-buf/src/read.rs +++ b/azalea-buf/src/read.rs @@ -5,11 +5,11 @@ use std::{ io::{Cursor, Read}, }; -use byteorder::{ReadBytesExt, BE}; +use byteorder::{BE, ReadBytesExt}; use thiserror::Error; use tracing::warn; -use super::{UnsizedByteArray, MAX_STRING_LENGTH}; +use super::{MAX_STRING_LENGTH, UnsizedByteArray}; #[derive(Error, Debug)] pub enum BufReadError { @@ -19,7 +19,9 @@ pub enum BufReadError { InvalidVarLong, #[error("Error reading bytes")] CouldNotReadBytes, - #[error("The received encoded string buffer length is longer than maximum allowed ({length} > {max_length})")] + #[error( + "The received encoded string buffer length is longer than maximum allowed ({length} > {max_length})" + )] StringLengthTooLong { length: u32, max_length: u32 }, #[error("The received Vec length is longer than maximum allowed ({length} > {max_length})")] VecLengthTooLong { length: u32, max_length: u32 }, diff --git a/azalea-buf/src/serializable_uuid.rs b/azalea-buf/src/serializable_uuid.rs index 53eccbbb..10e57eeb 100755 --- a/azalea-buf/src/serializable_uuid.rs +++ b/azalea-buf/src/serializable_uuid.rs @@ -2,7 +2,7 @@ use std::io::{Cursor, Write}; use uuid::Uuid; -use crate::{read::BufReadError, AzaleaRead, AzaleaWrite}; +use crate::{AzaleaRead, AzaleaWrite, read::BufReadError}; pub trait SerializableUuid { fn to_int_array(&self) -> [u32; 4]; diff --git a/azalea-buf/src/write.rs b/azalea-buf/src/write.rs index 73bcbdce..c4b9f413 100755 --- a/azalea-buf/src/write.rs +++ b/azalea-buf/src/write.rs @@ -5,7 +5,7 @@ use std::{ use byteorder::{BigEndian, WriteBytesExt}; -use super::{UnsizedByteArray, MAX_STRING_LENGTH}; +use super::{MAX_STRING_LENGTH, UnsizedByteArray}; fn write_utf_with_len(buf: &mut impl Write, string: &str, len: usize) -> Result<(), io::Error> { if string.len() > len { |
