From 7068ac029d234d2d6fdde434de59947ca0dd3981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=20Gramn=C3=A6s=20Tjernshaugen?= Date: Tue, 19 Mar 2024 18:33:55 +0100 Subject: [PATCH] Format code --- src/slack.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/slack.rs b/src/slack.rs index 0a343d1..a65b860 100644 --- a/src/slack.rs +++ b/src/slack.rs @@ -148,16 +148,10 @@ async fn handle_slash_command( message: incoming::Incoming, ) -> outgoing::SlackOutgoingMessage { let command_spin_mode = match message.payload.command.as_str() { - "/spin" => { - Some(SpinMode::Any) - }, - "/spin-vegan" => { - Some(SpinMode::Vegan) - }, - "/spin-vegetarian" => { - Some(SpinMode::Vegetarian) - }, - _ => { None } + "/spin" => Some(SpinMode::Any), + "/spin-vegan" => Some(SpinMode::Vegan), + "/spin-vegetarian" => Some(SpinMode::Vegetarian), + _ => None, }; match command_spin_mode { @@ -167,7 +161,7 @@ async fn handle_slash_command( message.envelope_id, None, )) - }, + } Some(spin_mode) => { let pizza = get_random_pizza(spin_mode); let outgoing_message = outgoing::SlashCommandOutgoingMessage {