From c42faaf6a3d33710919f4289f005abd9f17f1aa0 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 16 Feb 2022 20:05:59 -0800 Subject: [PATCH] cargo fmt --- src/commands/challenge.rs | 12 ++++++++++-- src/commands/owner.rs | 14 ++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/commands/challenge.rs b/src/commands/challenge.rs index cd95181..3488411 100644 --- a/src/commands/challenge.rs +++ b/src/commands/challenge.rs @@ -127,12 +127,20 @@ async fn submit(ctx: &Context, msg: &Message) -> CommandResult { let guild = msg.guild_id.unwrap().as_u64().to_string(); let current_guild_data = &guild_data[&guild].as_object().unwrap(); if !guild_data.contains_key(&guild) || !current_guild_data.contains_key("submissionChannel") { - msg.reply(&ctx.http, "Submissions aren't enabled for this server yet.").await?; + msg.reply(&ctx.http, "Submissions aren't enabled for this server yet.") + .await?; return Ok(()); } let submission_channel = current_guild_data["submissionChannel"].as_str().unwrap(); if submission_channel != &msg.channel_id.as_u64().to_string() { - msg.reply(&ctx.http, format!("Sorry, submissions aren't permitted here. Please go to <#{}>. Thanks!", guild)).await?; + msg.reply( + &ctx.http, + format!( + "Sorry, submissions aren't permitted here. Please go to <#{}>. Thanks!", + guild + ), + ) + .await?; return Ok(()); } if msg.attachments.len() == 0 { diff --git a/src/commands/owner.rs b/src/commands/owner.rs index c2fcd4c..df14840 100644 --- a/src/commands/owner.rs +++ b/src/commands/owner.rs @@ -2,9 +2,9 @@ use serenity::framework::standard::{macros::command, CommandResult}; use serenity::model::prelude::*; use serenity::prelude::*; +use serde_json::json; use serde_json::Map; use serde_json::Value; -use serde_json::json; use std::fs::File; use std::fs::OpenOptions; use std::io::Read; @@ -83,12 +83,14 @@ async fn setSubmissionChannel(ctx: &Context, msg: &Message) -> CommandResult { } guild_data[&guild] = current_guild_data.into(); } else { - guild_data.insert(guild, json!({ - "submissionChannel": channel - })); + guild_data.insert(guild, json!({ "submissionChannel": channel })); } set_guild_data(guild_data); // TODO: Add guild name in message - msg.reply(&ctx.http, format!("Submission channel set to <#{}>.", msg.channel_id)).await?; + msg.reply( + &ctx.http, + format!("Submission channel set to <#{}>.", msg.channel_id), + ) + .await?; Ok(()) -} \ No newline at end of file +}