From 46ce29210d63f737b2f15c8cba331522e16d998b Mon Sep 17 00:00:00 2001 From: GnomedDev Date: Thu, 16 Nov 2023 21:40:34 +0000 Subject: [PATCH] Fix clippy warnings --- examples/basic_structure/main.rs | 12 ++++++------ examples/fluent_localization/translation.rs | 4 ++-- src/cooldown.rs | 2 +- src/lib.rs | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/basic_structure/main.rs b/examples/basic_structure/main.rs index 55bd6d647d50..b256ac5709af 100644 --- a/examples/basic_structure/main.rs +++ b/examples/basic_structure/main.rs @@ -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 { @@ -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 { diff --git a/examples/fluent_localization/translation.rs b/examples/fluent_localization/translation.rs index ac2b9860aa9b..215d16488345 100644 --- a/examples/fluent_localization/translation.rs +++ b/examples/fluent_localization/translation.rs @@ -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<'_>>, diff --git a/src/cooldown.rs b/src/cooldown.rs index 1b17b0c81283..d6cd2a6f9812 100644 --- a/src/cooldown.rs +++ b/src/cooldown.rs @@ -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, diff --git a/src/lib.rs b/src/lib.rs index 48770cf723c8..468dea7a7f1d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -507,7 +507,7 @@ async fn catch_unwind_maybe( mod tests { fn _assert_send_sync() {} - fn _test_framework_error_send_sync<'a, U: Send + Sync + 'static, E: Send + Sync + 'static>() { - _assert_send_sync::>(); + fn _test_framework_error_send_sync() { + _assert_send_sync::>(); } }