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/connect.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'azalea-protocol/src/connect.rs') diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs index 06b306b9..cb837ba5 100755 --- a/azalea-protocol/src/connect.rs +++ b/azalea-protocol/src/connect.rs @@ -189,6 +189,7 @@ where } /// Split the reader and writer into two objects. This doesn't allocate. + #[must_use] pub fn into_split(self) -> (ReadConnection, WriteConnection) { (self.reader, self.writer) } @@ -229,12 +230,14 @@ impl Connection { /// Change our state from handshake to login. This is the state that is used /// for logging in. + #[must_use] pub fn login(self) -> Connection { Connection::from(self) } /// Change our state from handshake to status. This is the state that is /// used for pinging the server. + #[must_use] pub fn status(self) -> Connection { Connection::from(self) } @@ -265,6 +268,7 @@ impl Connection { /// Change our state from login to game. This is the state that's used when /// you're actually in the game. + #[must_use] pub fn game(self) -> Connection { Connection::from(self) } @@ -343,12 +347,14 @@ impl Connection { impl Connection { /// Change our state from handshake to login. This is the state that is used /// for logging in. + #[must_use] pub fn login(self) -> Connection { Connection::from(self) } /// Change our state from handshake to status. This is the state that is /// used for pinging the server. + #[must_use] pub fn status(self) -> Connection { Connection::from(self) } @@ -379,6 +385,7 @@ impl Connection { /// Change our state from login to game. This is the state that's used when /// the client is actually in the game. + #[must_use] pub fn game(self) -> Connection { Connection::from(self) } @@ -406,6 +413,7 @@ where { /// Creates a `Connection` of a type from a `Connection` of another type. /// Useful for servers or custom packets. + #[must_use] pub fn from(connection: Connection) -> Connection where R2: ProtocolPacket + Debug, -- cgit v1.2.3