From 0a4be91cd29102eb8bd742da57516166e1b807f0 Mon Sep 17 00:00:00 2001 From: minneelyyyy Date: Fri, 11 Oct 2024 20:52:24 -0400 Subject: [PATCH] better use of `use` --- src/commands/ping.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/ping.rs b/src/commands/ping.rs index e380943..6132b7d 100644 --- a/src/commands/ping.rs +++ b/src/commands/ping.rs @@ -1,15 +1,15 @@ use crate::common::{Context, Error}; +use std::time::Instant; +use poise::reply::CreateReply; /// Display the bot's latency to Discord's REST and Gateway APIs #[poise::command(slash_command, prefix_command)] pub async fn ping(ctx: Context<'_>) -> Result<(), Error> { - use std::time::Instant; - let start = Instant::now(); let msg = ctx.say("Pong! \u{1F3D3}").await?; let time = start.elapsed(); - msg.edit(ctx, poise::reply::CreateReply::default() + msg.edit(ctx, CreateReply::default() .content(format!("Pong! \u{1F3D3}\nREST: {:.2?}\nGateway: {:.2?}", time, ctx.ping().await))).await?;