Skip to content
Open
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
1 change: 1 addition & 0 deletions src/client/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ macro_rules! event_handler {
$( #[deprecated = $deprecated] )?
async fn $method_name(&self, $($context: Context,)? $( $arg_name: $arg_type ),*) {
// Suppress unused argument warnings
#[allow(clippy::double_parens)]
drop(( $($context,)? $($arg_name),* ))
Comment on lines +24 to 25
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[allow(clippy::double_parens)]
drop(( $($context,)? $($arg_name),* ))
drop(( $($context,)? $($arg_name,)* ))

This way the macro will produce 1-tuples instead of parenthesized single values.

}
)*
Expand Down
8 changes: 2 additions & 6 deletions src/gateway/bridge/shard_queuer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,9 @@ impl ShardQueuer {
let duration = Duration::from_secs(WAIT_BETWEEN_BOOTS_IN_SECONDS);
let elapsed = instant.elapsed();

if elapsed >= duration {
return;
if let Some(to_sleep) = duration.checked_sub(elapsed) {
sleep(to_sleep).await;
}

let to_sleep = duration - elapsed;

sleep(to_sleep).await;
}

#[instrument(skip(self))]
Expand Down
Loading