From cfb190d00c70f1b09789e23f89a3c67840e0fd87 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Fri, 2 Sep 2022 12:11:14 -0500 Subject: get rid of Readable & Writable (#21) --- azalea-protocol/src/read.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'azalea-protocol/src/read.rs') diff --git a/azalea-protocol/src/read.rs b/azalea-protocol/src/read.rs index e7466c12..9ca102c1 100755 --- a/azalea-protocol/src/read.rs +++ b/azalea-protocol/src/read.rs @@ -1,6 +1,6 @@ use crate::packets::ProtocolPacket; use azalea_buf::McBufVarReadable; -use azalea_buf::{read_varint_async, BufReadError, Readable}; +use azalea_buf::{read_varint_async, BufReadError}; use azalea_crypto::Aes128CfbDec; use flate2::read::ZlibDecoder; use std::{ @@ -78,9 +78,8 @@ where fn packet_decoder(stream: &mut impl Read) -> Result { // Packet ID - let packet_id = stream - .read_varint() - .map_err(|e| ReadPacketError::ReadPacketId { source: e })?; + let packet_id = + u32::var_read_from(stream).map_err(|e| ReadPacketError::ReadPacketId { source: e })?; P::read(packet_id.try_into().unwrap(), stream) } -- cgit v1.2.3