diff --git a/src/commands/info.rs b/src/commands/info.rs index 530c812..8857df7 100644 --- a/src/commands/info.rs +++ b/src/commands/info.rs @@ -1,8 +1,8 @@ -use time::OffsetDateTime; use serenity::builder::{CreateApplicationCommand, CreateEmbed}; use serenity::model::prelude::interaction::application_command::ApplicationCommandInteraction; use serenity::prelude::Context; use serenity::utils::Colour; +use time::OffsetDateTime; use crate::data::UptimeData; use crate::utils::calculate_latency::calculate_latency; @@ -14,14 +14,12 @@ pub async fn run(ctx: Context, command: ApplicationCommandInteraction) { let uptime = data.get::(); // start measuring latency - let ping_start = OffsetDateTime::now_utc(); + let ping_start = OffsetDateTime::now_utc(); let embed = generate_embed("Pinging...".to_string(), uptime, &version); command .create_interaction_response(&ctx.http, |response| { - response.interaction_response_data(|message| { - message.set_embed(embed) - }) + response.interaction_response_data(|message| message.set_embed(embed)) }) .await .unwrap(); diff --git a/src/data.rs b/src/data.rs index d0bf93e..6a1d145 100644 --- a/src/data.rs +++ b/src/data.rs @@ -1,7 +1,7 @@ use std::{collections::HashMap, sync::Arc}; -use time::OffsetDateTime; use serenity::{model::prelude::UserId, prelude::TypeMapKey}; +use time::OffsetDateTime; use tokio::sync::Mutex; use crate::{database::Database, environment::Configuration, pagination::Pagination}; diff --git a/src/main.rs b/src/main.rs index 93e38be..c367067 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,10 @@ use std::collections::HashMap; use std::sync::Arc; -use time::OffsetDateTime; use data::{PaginationMap, UptimeData}; use database::Database; use serenity::prelude::*; +use time::OffsetDateTime; mod api; mod commands; diff --git a/src/utils/calculate_latency.rs b/src/utils/calculate_latency.rs index 2c152dc..defd612 100644 --- a/src/utils/calculate_latency.rs +++ b/src/utils/calculate_latency.rs @@ -1,7 +1,7 @@ -use time::OffsetDateTime; +use time::OffsetDateTime; pub fn calculate_latency(start: OffsetDateTime, end: OffsetDateTime) -> i64 { - let start_ts = start.unix_timestamp(); + let start_ts = start.unix_timestamp(); let start_ts_ss = start.millisecond() as i64; let end_ts = end.unix_timestamp(); let end_ts_ss = end.millisecond() as i64; diff --git a/src/utils/git.rs b/src/utils/git.rs index 5b7f6da..9a37cba 100644 --- a/src/utils/git.rs +++ b/src/utils/git.rs @@ -1,7 +1,7 @@ use std::fmt::Display; -use time::OffsetDateTime; use git2::{ErrorCode, Repository}; +use time::OffsetDateTime; #[derive(Clone)] pub struct VersionInfo {