Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy warnings #220

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>>();
}
}
Loading