From 6e818852d868eea963dd2b8489ba75b65c56fb1c Mon Sep 17 00:00:00 2001 From: EightFactorial Date: Mon, 30 Jan 2023 16:18:14 -0800 Subject: More packet fixes, tests, handle error (#61) * Fix packet, fix tests, fixedbitsets * Clippy: Nightmare Mode * Fix mistake * simplify impl Display and make thing pub --------- Co-authored-by: mat --- azalea-protocol/src/packets/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'azalea-protocol/src/packets/mod.rs') diff --git a/azalea-protocol/src/packets/mod.rs b/azalea-protocol/src/packets/mod.rs index 508d06a6..e803e85f 100755 --- a/azalea-protocol/src/packets/mod.rs +++ b/azalea-protocol/src/packets/mod.rs @@ -21,6 +21,7 @@ pub enum ConnectionProtocol { } impl ConnectionProtocol { + #[must_use] pub fn from_i32(i: i32) -> Option { match i { -1 => Some(ConnectionProtocol::Handshake), @@ -39,7 +40,7 @@ where { fn id(&self) -> u32; - /// Read a packet by its id, ConnectionProtocol, and flow + /// Read a packet by its id, `ConnectionProtocol`, and flow fn read(id: u32, buf: &mut Cursor<&[u8]>) -> Result>; fn write(&self, buf: &mut impl Write) -> Result<(), std::io::Error>; -- cgit v1.2.3