Skip to content

Commit

Permalink
fix nbt bug
Browse files Browse the repository at this point in the history
  • Loading branch information
theaddonn committed Jul 30, 2024
1 parent 4d74553 commit 1ccfcf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nbt/src/endian/little_endian_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl NbtByteOrder for NbtLittleEndianNetwork {

#[inline]
fn write_i16(buf: &mut Vec<u8>, int16: i16) -> Result<(), NbtError> {
LE::<i16>::write(&LE::new(int16), buf).map_err(|e| NbtError::IOError(Arc::new(e)))
VAR::<i16>::write(&VAR::new(int16), buf).map_err(|e| NbtError::IOError(Arc::new(e)))
}

#[inline]
Expand Down Expand Up @@ -60,7 +60,7 @@ impl NbtByteOrder for NbtLittleEndianNetwork {

#[inline]
fn read_i16(buf: &mut Cursor<&[u8]>) -> Result<i16, NbtError> {
match LE::<i16>::read(buf) {
match VAR::<i16>::read(buf) {
Ok(v) => Ok(v.into_inner()),
Err(e) => Err(NbtError::IOError(Arc::new(e))),
}
Expand Down

0 comments on commit 1ccfcf9

Please sign in to comment.