diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2026-01-13 10:51:45 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-13 10:51:45 -0600 |
| commit | b21ac946cafaacc9ee2478ea48ed9e72554f79ed (patch) | |
| tree | 4d05744b9801e94f5da6563d8fabddfb20d1c7b7 /azalea-chat/src | |
| parent | d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff (diff) | |
| download | azalea-drasl-b21ac946cafaacc9ee2478ea48ed9e72554f79ed.tar.xz | |
Merge AzaleaRead and AzaleaWrite (#305)
Diffstat (limited to 'azalea-chat/src')
| -rw-r--r-- | azalea-chat/src/component.rs | 8 | ||||
| -rw-r--r-- | azalea-chat/src/numbers.rs | 8 |
2 files changed, 4 insertions, 12 deletions
diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index c64ee559..b338fe2d 100644 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -6,7 +6,7 @@ use std::{ }; #[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] -use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; +use azalea_buf::{AzBuf, BufReadError}; use serde::{Deserialize, Deserializer, Serialize, de}; use crate::{ @@ -635,7 +635,7 @@ impl From<&simdnbt::Mutf8Str> for FormattedText { } #[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] -impl AzaleaRead for FormattedText { +impl AzBuf for FormattedText { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { use simdnbt::FromNbtTag; use tracing::trace; @@ -652,10 +652,6 @@ impl AzaleaRead for FormattedText { _ => Ok(FormattedText::default()), } } -} - -#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] -impl AzaleaWrite for FormattedText { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { use simdnbt::Serialize; diff --git a/azalea-chat/src/numbers.rs b/azalea-chat/src/numbers.rs index 60b599e8..f739c543 100644 --- a/azalea-chat/src/numbers.rs +++ b/azalea-chat/src/numbers.rs @@ -5,7 +5,7 @@ use std::io::{self, Cursor, Write}; #[cfg(feature = "azalea-buf")] -use azalea_buf::{AzaleaRead, AzaleaWrite}; +use azalea_buf::AzBuf; #[cfg(feature = "azalea-buf")] use azalea_registry::builtin::NumberFormatKind; use simdnbt::owned::Nbt; @@ -20,7 +20,7 @@ pub enum NumberFormat { } #[cfg(feature = "azalea-buf")] -impl AzaleaRead for NumberFormat { +impl AzBuf for NumberFormat { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, azalea_buf::BufReadError> { let kind = NumberFormatKind::azalea_read(buf)?; match kind { @@ -33,10 +33,6 @@ impl AzaleaRead for NumberFormat { }), } } -} - -#[cfg(feature = "azalea-buf")] -impl AzaleaWrite for NumberFormat { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { match self { NumberFormat::Blank => NumberFormatKind::Blank.azalea_write(buf)?, |
