From 892869ad1249e238eb9228d57bd9884793a9fe75 Mon Sep 17 00:00:00 2001 From: veronoicc <64193056+veronoicc@users.noreply.github.com> Date: Tue, 14 May 2024 23:59:36 +0200 Subject: Update simdnbt dep (#148) * Update simdnbt dep * Fix not compiling (rust analyzer is still yapping, i trust you cargo check) * Update simdnbt to 0.5.2 * finally everything works :prayge: --- azalea-chat/src/component.rs | 3 +-- azalea-chat/src/numbers.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'azalea-chat/src') diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 01c3a370..94d653e8 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -470,8 +470,7 @@ impl simdnbt::FromNbtTag for FormattedText { #[cfg(feature = "azalea-buf")] impl McBufReadable for FormattedText { fn read_from(buf: &mut std::io::Cursor<&[u8]>) -> Result { - let alloc = Default::default(); - let nbt = simdnbt::borrow::NbtTag::read_optional(buf, &alloc)?; + let nbt = simdnbt::borrow::read_optional_tag(buf)?; if let Some(nbt) = nbt { FormattedText::from_nbt_tag(&nbt).ok_or(BufReadError::Custom( "couldn't convert nbt to chat message".to_owned(), diff --git a/azalea-chat/src/numbers.rs b/azalea-chat/src/numbers.rs index 21c30591..a5a88c4f 100644 --- a/azalea-chat/src/numbers.rs +++ b/azalea-chat/src/numbers.rs @@ -24,7 +24,7 @@ impl McBufReadable for NumberFormat { match kind { NumberFormatKind::Blank => Ok(NumberFormat::Blank), NumberFormatKind::Styled => Ok(NumberFormat::Styled { - style: Nbt::read(buf)?, + style: simdnbt::owned::read(buf)?, }), NumberFormatKind::Fixed => Ok(NumberFormat::Fixed { value: FormattedText::read_from(buf)?, -- cgit v1.2.3