aboutsummaryrefslogtreecommitdiff
path: root/azalea-buf/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-buf/src')
-rwxr-xr-xazalea-buf/src/lib.rs3
-rwxr-xr-xazalea-buf/src/read.rs6
-rwxr-xr-xazalea-buf/src/serializable_uuid.rs4
-rwxr-xr-xazalea-buf/src/write.rs6
4 files changed, 13 insertions, 6 deletions
diff --git a/azalea-buf/src/lib.rs b/azalea-buf/src/lib.rs
index fbde3684..e1d1281f 100755
--- a/azalea-buf/src/lib.rs
+++ b/azalea-buf/src/lib.rs
@@ -20,9 +20,10 @@ const MAX_STRING_LENGTH: u16 = 32767;
#[cfg(test)]
mod tests {
- use super::*;
use std::{collections::HashMap, io::Cursor};
+ use super::*;
+
#[test]
fn test_write_varint() {
let mut buf = Vec::new();
diff --git a/azalea-buf/src/read.rs b/azalea-buf/src/read.rs
index 882e2bce..8e406acb 100755
--- a/azalea-buf/src/read.rs
+++ b/azalea-buf/src/read.rs
@@ -1,14 +1,16 @@
-use super::{UnsizedByteArray, MAX_STRING_LENGTH};
-use byteorder::{ReadBytesExt, BE};
use std::{
backtrace::Backtrace,
collections::HashMap,
hash::Hash,
io::{Cursor, Read},
};
+
+use byteorder::{ReadBytesExt, BE};
use thiserror::Error;
use tracing::warn;
+use super::{UnsizedByteArray, MAX_STRING_LENGTH};
+
#[derive(Error, Debug)]
pub enum BufReadError {
#[error("Invalid VarInt")]
diff --git a/azalea-buf/src/serializable_uuid.rs b/azalea-buf/src/serializable_uuid.rs
index f42eed86..d4ec0315 100755
--- a/azalea-buf/src/serializable_uuid.rs
+++ b/azalea-buf/src/serializable_uuid.rs
@@ -1,7 +1,9 @@
-use crate::{read::BufReadError, McBufReadable, McBufWritable};
use std::io::{Cursor, Write};
+
use uuid::Uuid;
+use crate::{read::BufReadError, McBufReadable, McBufWritable};
+
pub trait SerializableUuid {
fn to_int_array(&self) -> [u32; 4];
fn from_int_array(array: [u32; 4]) -> Self;
diff --git a/azalea-buf/src/write.rs b/azalea-buf/src/write.rs
index 61dedfd8..49215a5a 100755
--- a/azalea-buf/src/write.rs
+++ b/azalea-buf/src/write.rs
@@ -1,7 +1,9 @@
-use super::{UnsizedByteArray, MAX_STRING_LENGTH};
-use byteorder::{BigEndian, WriteBytesExt};
use std::{collections::HashMap, io::Write};
+use byteorder::{BigEndian, WriteBytesExt};
+
+use super::{UnsizedByteArray, MAX_STRING_LENGTH};
+
fn write_utf_with_len(
buf: &mut impl Write,
string: &str,