aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples/echo.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-05-30 19:36:59 -0800
committermat <git@matdoes.dev>2025-05-30 19:36:59 -0800
commitae4b1e85e669bc882d158509ef1eda46c6b2a72e (patch)
treeadf81cc01b0ce1575e95b99ad109fd92db1738f6 /azalea/examples/echo.rs
parenta64c6505049082175224802c5be51ac8f0cf4677 (diff)
downloadazalea-drasl-ae4b1e85e669bc882d158509ef1eda46c6b2a72e.tar.xz
fix clippy issues and improve formatting everywhere
Diffstat (limited to 'azalea/examples/echo.rs')
-rw-r--r--azalea/examples/echo.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/azalea/examples/echo.rs b/azalea/examples/echo.rs
index 1e773b7d..80b0cb15 100644
--- a/azalea/examples/echo.rs
+++ b/azalea/examples/echo.rs
@@ -18,13 +18,14 @@ async fn main() {
pub struct State {}
async fn handle(bot: Client, event: Event, _state: State) -> anyhow::Result<()> {
- if let Event::Chat(m) = event {
- if let (Some(sender), content) = m.split_sender_and_content() {
- if sender == bot.username() {
- return Ok(()); // ignore our own messages
- }
- bot.chat(&content);
- };
+ if let Event::Chat(m) = event
+ && let (Some(sender), content) = m.split_sender_and_content()
+ {
+ if sender == bot.username() {
+ // ignore our own messages
+ return Ok(());
+ }
+ bot.chat(&content);
}
Ok(())