From b21ac946cafaacc9ee2478ea48ed9e72554f79ed Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Tue, 13 Jan 2026 10:51:45 -0600 Subject: Merge AzaleaRead and AzaleaWrite (#305) --- azalea-auth/src/game_profile.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'azalea-auth/src') diff --git a/azalea-auth/src/game_profile.rs b/azalea-auth/src/game_profile.rs index 99af322d..ff456bc9 100644 --- a/azalea-auth/src/game_profile.rs +++ b/azalea-auth/src/game_profile.rs @@ -3,9 +3,7 @@ use std::{ sync::Arc, }; -use azalea_buf::{ - AzBuf, AzaleaRead, AzaleaReadLimited, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError, -}; +use azalea_buf::{AzBuf, AzBufLimited, AzBufVar, BufReadError}; use indexmap::IndexMap; use serde::{Deserialize, Serialize, Serializer}; use uuid::Uuid; @@ -53,7 +51,7 @@ impl From for GameProfile { pub struct GameProfileProperties { pub map: IndexMap, } -impl AzaleaRead for GameProfileProperties { +impl AzBuf for GameProfileProperties { fn azalea_read(buf: &mut io::Cursor<&[u8]>) -> Result { let mut properties = IndexMap::new(); let properties_len = u32::azalea_read_var(buf)?; @@ -70,8 +68,6 @@ impl AzaleaRead for GameProfileProperties { } Ok(GameProfileProperties { map: properties }) } -} -impl AzaleaWrite for GameProfileProperties { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { (self.map.len() as u64).azalea_write_var(buf)?; for (key, value) in &self.map { @@ -87,14 +83,12 @@ pub struct ProfilePropertyValue { pub value: String, pub signature: Option, } -impl AzaleaRead for ProfilePropertyValue { +impl AzBuf for ProfilePropertyValue { fn azalea_read(buf: &mut io::Cursor<&[u8]>) -> Result { let value = String::azalea_read_limited(buf, 32767)?; let signature = Option::::azalea_read_limited(buf, 1024)?; Ok(ProfilePropertyValue { value, signature }) } -} -impl AzaleaWrite for ProfilePropertyValue { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { self.value.azalea_write(buf)?; self.signature.azalea_write(buf)?; -- cgit v1.2.3