Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
washbin committed Oct 16, 2022
1 parent e72f9ce commit 92b2185
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
8 changes: 3 additions & 5 deletions src/commands/info.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -14,14 +14,12 @@ pub async fn run(ctx: Context, command: ApplicationCommandInteraction) {
let uptime = data.get::<UptimeData>();

// 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();
Expand Down
2 changes: 1 addition & 1 deletion src/data.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/calculate_latency.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/git.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::fmt::Display;

use time::OffsetDateTime;
use git2::{ErrorCode, Repository};
use time::OffsetDateTime;

#[derive(Clone)]
pub struct VersionInfo {
Expand Down

0 comments on commit 92b2185

Please sign in to comment.