summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorseth <[email protected]>2023-04-07 20:02:01 -0400
committerseth <[email protected]>2023-04-07 20:02:01 -0400
commit065ac97194b7640ca350b4770b404d855bf98b17 (patch)
treed7ef12c7fd1b552fdd39987979439f1bddeab0e8 /src
parentbb3df7e6ab9de4c52fbe81b589ac5d1add6d281d (diff)
cargo fmt
Diffstat (limited to 'src')
-rw-r--r--src/main.rs16
-rw-r--r--src/utils.rs8
2 files changed, 11 insertions, 13 deletions
diff --git a/src/main.rs b/src/main.rs
index 927e0e8..e5b9bb9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -62,7 +62,7 @@ impl EventHandler for Handler {
commands::copypasta::run(&command.data.options, command.channel_id, &ctx.http)
.await
}
- "random_lore" => commands::random_lore::run(&command.data.options).await,
+ "random_lore" => commands::random_lore::run(&command.data.options).await,
"random_teawie" => commands::random_teawie::run(&command.data.options).await,
_ => "not implemented :(".to_string(),
};
@@ -91,7 +91,7 @@ impl EventHandler for Handler {
.create_application_command(|command| commands::bottom_decode::register(command))
.create_application_command(|command| commands::bottom_encode::register(command))
.create_application_command(|command| commands::copypasta::register(command))
- .create_application_command(|command| commands::random_lore::register(command))
+ .create_application_command(|command| commands::random_lore::register(command))
.create_application_command(|command| commands::random_teawie::register(command))
})
.await;
@@ -141,12 +141,12 @@ async fn ask(ctx: &Context, msg: &Message) -> CommandResult {
#[command]
async fn random_lore(ctx: &Context, msg: &Message) -> CommandResult {
- let resp = utils::get_random_lore().await;
- msg.channel_id
- .send_message(&ctx.http, |m| m.content(resp))
- .await?;
-
- Ok(())
+ let resp = utils::get_random_lore().await;
+ msg.channel_id
+ .send_message(&ctx.http, |m| m.content(resp))
+ .await?;
+
+ Ok(())
}
#[command]
diff --git a/src/utils.rs b/src/utils.rs
index bb57521..78e02dd 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -13,9 +13,7 @@ const FILES: Dir = include_dir!("src/include");
*/
async fn random_choice<const N: usize>(arr: [&str; N]) -> String {
let mut rng = rand::thread_rng();
- let resp = arr
- .choose(&mut rng)
- .expect("couldn't choose random value!");
+ let resp = arr.choose(&mut rng).expect("couldn't choose random value!");
resp.to_string()
}
@@ -25,11 +23,11 @@ async fn random_choice<const N: usize>(arr: [&str; N]) -> String {
*/
pub async fn get_random_response() -> String {
- random_choice(RESPONSES).await
+ random_choice(RESPONSES).await
}
pub async fn get_random_lore() -> String {
- random_choice(LORE).await
+ random_choice(LORE).await
}
/*