diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-09-02 12:11:14 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-02 12:11:14 -0500 |
| commit | cfb190d00c70f1b09789e23f89a3c67840e0fd87 (patch) | |
| tree | 9bdc021943753d60bf437526c4c294275eae13ac /azalea-protocol/src/read.rs | |
| parent | 32458d743f757da3193717fe5554f490703640c0 (diff) | |
| download | azalea-drasl-cfb190d00c70f1b09789e23f89a3c67840e0fd87.tar.xz | |
get rid of Readable & Writable (#21)
Diffstat (limited to 'azalea-protocol/src/read.rs')
| -rwxr-xr-x | azalea-protocol/src/read.rs | 7 |
1 files changed, 3 insertions, 4 deletions
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<P: ProtocolPacket>(stream: &mut impl Read) -> Result<P, ReadPacketError> { // 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) } |
