Skip to content

Commit

Permalink
Fix clippy warnings (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev authored Nov 17, 2023
1 parent e6a7337 commit 008e2d9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions examples/basic_structure/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ async fn main() {
],
..Default::default()
},
/// The global error handler for all error cases that may occur
// The global error handler for all error cases that may occur
on_error: |error| Box::pin(on_error(error)),
/// This code is run before every command
// This code is run before every command
pre_command: |ctx| {
Box::pin(async move {
println!("Executing command {}...", ctx.command().qualified_name);
})
},
/// This code is run after a command if it was successful (returned Ok)
// This code is run after a command if it was successful (returned Ok)
post_command: |ctx| {
Box::pin(async move {
println!("Executed command {}!", ctx.command().qualified_name);
})
},
/// Every command invocation must pass this check to continue execution
// Every command invocation must pass this check to continue execution
command_check: Some(|ctx| {
Box::pin(async move {
if ctx.author().id == 123456789 {
Expand All @@ -71,8 +71,8 @@ async fn main() {
Ok(true)
})
}),
/// Enforce command checks even for owners (enforced by default)
/// Set to true to bypass checks, which is useful for testing
// Enforce command checks even for owners (enforced by default)
// Set to true to bypass checks, which is useful for testing
skip_checks_for_owners: false,
event_handler: |_ctx, event, _framework, _data| {
Box::pin(async move {
Expand Down
4 changes: 2 additions & 2 deletions examples/fluent_localization/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ pub fn format(
}

/// Retrieves the appropriate language file depending on user locale and calls [`format`]
pub fn get<'a>(
ctx: Context<'a>,
pub fn get(
ctx: Context,
id: &str,
attr: Option<&str>,
args: Option<&fluent::FluentArgs<'_>>,
Expand Down
2 changes: 1 addition & 1 deletion src/cooldown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl CooldownTracker {
/// Create a new cooldown tracker
pub fn new_2() -> Self {
Self {
/// Removed in next version; unused by new API
// Removed in next version; unused by new API
cooldown: CooldownConfig::default(),

global_invocation: None,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ async fn catch_unwind_maybe<T>(
mod tests {
fn _assert_send_sync<T: Send + Sync>() {}

fn _test_framework_error_send_sync<'a, U: Send + Sync + 'static, E: Send + Sync + 'static>() {
_assert_send_sync::<crate::FrameworkError<'a, U, E>>();
fn _test_framework_error_send_sync<U: Send + Sync + 'static, E: Send + Sync + 'static>() {
_assert_send_sync::<crate::FrameworkError<'_, U, E>>();
}
}

0 comments on commit 008e2d9

Please sign in to comment.