Skip to content

Commit 109a402

Browse files
committed
Fix clippy warnings
1 parent 03c6681 commit 109a402

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/client/event_handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ macro_rules! event_handler {
2121
$( #[deprecated = $deprecated] )?
2222
async fn $method_name(&self, $($context: Context,)? $( $arg_name: $arg_type ),*) {
2323
// Suppress unused argument warnings
24+
#[allow(clippy::double_parens)]
2425
drop(( $($context,)? $($arg_name),* ))
2526
}
2627
)*

src/gateway/bridge/shard_queuer.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,9 @@ impl ShardQueuer {
138138
let duration = Duration::from_secs(WAIT_BETWEEN_BOOTS_IN_SECONDS);
139139
let elapsed = instant.elapsed();
140140

141-
if elapsed >= duration {
142-
return;
141+
if let Some(to_sleep) = duration.checked_sub(elapsed) {
142+
sleep(to_sleep).await;
143143
}
144-
145-
let to_sleep = duration - elapsed;
146-
147-
sleep(to_sleep).await;
148144
}
149145

150146
#[instrument(skip(self))]

0 commit comments

Comments
 (0)