Run cargo fmt --all

This commit is contained in:
2025-08-25 20:03:21 -03:00
parent e5fe77c287
commit 676fdcfd96
6 changed files with 35 additions and 19 deletions
+8 -4
View File
@@ -5,9 +5,13 @@ use deadpool_redis::{cluster::PoolError, redis::RedisError};
use thiserror::Error; use thiserror::Error;
use twilight_http::response::DeserializeBodyError; use twilight_http::response::DeserializeBodyError;
use crate::{database::models::{DatabaseError, DatabaseOrDiscordError}, framework::{commands::{ use crate::{
arguments::Argument, context::CommandContext, permissions::Permission, database::models::{DatabaseError, DatabaseOrDiscordError},
}, runtime::Runtime}}; framework::{
commands::{arguments::Argument, context::CommandContext, permissions::Permission},
runtime::Runtime,
},
};
pub mod arguments; pub mod arguments;
pub mod context; pub mod context;
@@ -40,7 +44,7 @@ pub enum CommandError {
RedisFailed(#[from] RedisError), RedisFailed(#[from] RedisError),
#[error(transparent)] #[error(transparent)]
DatabaseOrDiscordError(#[from] DatabaseOrDiscordError) DatabaseOrDiscordError(#[from] DatabaseOrDiscordError),
} }
#[async_trait] #[async_trait]
+1 -3
View File
@@ -81,9 +81,7 @@ where
)) ))
.await .await
.inspect(|_| log::debug!("Executed component interaction")) .inspect(|_| log::debug!("Executed component interaction"))
.inspect_err(|e| { .inspect_err(|e| log::error!("Interaction execution failed: {e:?}"))
log::error!("Interaction execution failed: {e:?}")
})
} else { } else {
Err(InteractionError::InteractionNotFound) Err(InteractionError::InteractionNotFound)
} }
+13 -5
View File
@@ -3,14 +3,22 @@ use async_trait::async_trait;
use crate::{ use crate::{
extras::Extras, extras::Extras,
framework::commands::{ framework::commands::{
arguments::{Arg, Argument, NeedyString, ParseArguments}, context::CommandContext, Command, CommandError Command, CommandError,
arguments::{Arg, Argument, NeedyString, ParseArguments},
context::CommandContext,
}, },
groups::{about::{ groups::{
about::{
components::{ components::{
HelpDonateLinkButton, HelpGoBackButton, HelpSupportLinkButton, HelpWebsiteLinkButton, HelpDonateLinkButton, HelpGoBackButton, HelpSupportLinkButton,
HelpWebsiteLinkButton,
},
embeds::{
get_all_command_help_embed, get_command_help_embed, get_command_not_found_embed,
},
},
calls::components::CodeOfConductButton,
}, },
embeds::{get_all_command_help_embed, get_command_help_embed, get_command_not_found_embed},
}, calls::components::CodeOfConductButton},
state::State, state::State,
}; };
+3 -1
View File
@@ -11,7 +11,9 @@ use crate::{
database::models::Channel, database::models::Channel,
extras::Extras, extras::Extras,
framework::{ framework::{
commands::extras::ExtrasGetter, events::traits::{EventResult, OnMessageHandler}, runtime::Runtime commands::extras::ExtrasGetter,
events::traits::{EventResult, OnMessageHandler},
runtime::Runtime,
}, },
groups::leveling::constants::KEY_LEADERBOARD_MONTHLY, groups::leveling::constants::KEY_LEADERBOARD_MONTHLY,
state::State, state::State,
+5 -1
View File
@@ -111,7 +111,11 @@ pub fn u64_to_i64(u: u64) -> i64 {
/// Returns: /// Returns:
/// [`Option<(&str, &str)>`] - The splitted parts of the string, or [`None`] if no occurrences of /// [`Option<(&str, &str)>`] - The splitted parts of the string, or [`None`] if no occurrences of
/// `pattern` were found in `s`. /// `pattern` were found in `s`.
pub fn split_at_nth_from_end<'a, 'b>(s: &'a str, pattern: &'b str, n: usize) -> Option<(&'a str, &'a str)> { pub fn split_at_nth_from_end<'a, 'b>(
s: &'a str,
pattern: &'b str,
n: usize,
) -> Option<(&'a str, &'a str)> {
let mut end = s.len(); let mut end = s.len();
let mut count = 0; let mut count = 0;