From 88b1c617159cbb6c09578b9ced9eb9feaf4fa883 Mon Sep 17 00:00:00 2001 From: nothendev Date: Sun, 8 Oct 2023 21:01:08 +0300 Subject: [PATCH] fix warnings --- protocol/src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/protocol/src/lib.rs b/protocol/src/lib.rs index f4363b1..bb22073 100644 --- a/protocol/src/lib.rs +++ b/protocol/src/lib.rs @@ -23,7 +23,7 @@ pub mod nsfr; pub mod ser; pub use aott; pub use bytes; -use bytes::{Bytes, BytesMut}; +use bytes::BytesMut; pub use thiserror; use tokio_util::sync::CancellationToken; pub use uuid; @@ -147,8 +147,7 @@ use tokio::{ use crate::{ model::{ packets::{ - err_with_source, Packet, PacketContext, PluginMessage, SerializedPacket, - SerializedPacketCompressed, + Packet, PacketContext, PluginMessage, SerializedPacket, SerializedPacketCompressed, }, State, }, @@ -221,13 +220,13 @@ impl PlayerNet { loop { let bufslice = &buf[..]; let mut input = Input::new(&bufslice); - if let Some(packet) = match (if compressing__.get_copy().await { + if let Some(packet) = match if compressing__.get_copy().await { SerializedPacketCompressed::deserialize .parse_with(&mut input) .map(SerializedPacket::from) } else { SerializedPacket::deserialize.parse_with(&mut input) - }) { + } { Ok(packet) => Some(packet), Err(crate::error::Error::Ser( crate::ser::SerializationError::UnexpectedEof { .. },