aboutsummaryrefslogtreecommitdiff
path: root/azalea-buf/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-02-22 23:01:54 +0000
committermat <git@matdoes.dev>2025-02-22 23:01:54 +0000
commit34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (patch)
tree7920fec1203e8e96463a142f5f6da6164e76e684 /azalea-buf/src
parentbdd2fc91e11e2896d8e1c7046df247e1075bd40d (diff)
downloadazalea-drasl-34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6.tar.xz
update to rust edition 2024
Diffstat (limited to 'azalea-buf/src')
-rwxr-xr-xazalea-buf/src/read.rs8
-rwxr-xr-xazalea-buf/src/serializable_uuid.rs2
-rwxr-xr-xazalea-buf/src/write.rs2
3 files changed, 7 insertions, 5 deletions
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 {