From 2eade86cf7a12a6ec64496aedbfc3d3a3bd44e1a Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 23 Oct 2022 16:51:49 -0500 Subject: make `handle` cleaner Arc -> Event, Arc> -> State Items in State now need to have interior mutability (i.e. Arc>), but it's a worthwhile tradeoff since it allows the user to customize it for each field --- azalea-client/src/chat.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'azalea-client/src') diff --git a/azalea-client/src/chat.rs b/azalea-client/src/chat.rs index 9e3d58a0..fecd76ae 100644 --- a/azalea-client/src/chat.rs +++ b/azalea-client/src/chat.rs @@ -83,7 +83,7 @@ impl Client { /// # } /// ``` pub async fn chat(&self, message: &str) -> Result<(), std::io::Error> { - if message.chars().next() == Some('/') { + if message.starts_with('/') { self.send_command_packet(&message[1..]).await } else { self.send_chat_packet(message).await -- cgit v1.2.3