1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

update simdnbt

This commit is contained in:
mat 2024-09-15 06:52:16 +00:00
parent d5a281bf15
commit 2992fc6b47
2 changed files with 269 additions and 290 deletions

555
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -344,13 +344,13 @@ impl<T: McBufReadable, const N: usize> McBufReadable for [T; N] {
impl McBufReadable for simdnbt::owned::NbtTag {
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
Ok(simdnbt::owned::read_tag(buf)?)
Ok(simdnbt::owned::read_tag(buf).map_err(simdnbt::Error::from)?)
}
}
impl McBufReadable for simdnbt::owned::NbtCompound {
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
match simdnbt::owned::read_tag(buf)? {
match simdnbt::owned::read_tag(buf).map_err(simdnbt::Error::from)? {
simdnbt::owned::NbtTag::Compound(compound) => Ok(compound),
_ => Err(BufReadError::Custom("Expected compound tag".to_string())),
}