Skip to content

Commit

Permalink
Fix Rust 1.72 clippy lints (serenity-rs#2516)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski authored Aug 26, 2023
1 parent ba8c07a commit 45b39ea
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/client/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl fmt::Debug for Context {
f.debug_struct("Context")
.field("shard", &self.shard)
.field("shard_id", &self.shard_id)
.finish()
.finish_non_exhaustive()
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn update_cache<E>(_: &Context, _: &mut E) -> Option<()> {
None
}

pub(crate) async fn dispatch_model<'rec>(
pub(crate) fn dispatch_model(
event: Event,
context: Context,
#[cfg(feature = "framework")] framework: Option<Arc<dyn Framework>>,
Expand Down
2 changes: 1 addition & 1 deletion src/framework/standard/structures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub struct Command {

impl fmt::Debug for Command {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Command").field("options", &self.options).finish()
f.debug_struct("Command").field("options", &self.options).finish_non_exhaustive()
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/gateway/bridge/shard_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ impl ShardRunner {
self.framework.clone(),
self.event_handlers.clone(),
self.raw_event_handlers.clone(),
)
.await;
);
}

if !successful && !self.shard.stage().is_connecting() {
Expand Down
2 changes: 1 addition & 1 deletion src/model/guild/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl Guild {
let name = name.as_ref();
let guild_channels = cache.as_ref().guild_channels(self.id)?;

for channel_entry in guild_channels.iter() {
for channel_entry in &guild_channels {
let (id, channel) = channel_entry.pair();

if channel.name == name {
Expand Down
2 changes: 1 addition & 1 deletion src/model/guild/partial_guild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ impl PartialGuild {
let name = name.as_ref();
let guild_channels = cache.as_ref().guild_channels(self.id)?;

for channel_entry in guild_channels.iter() {
for channel_entry in &guild_channels {
let (id, channel) = channel_entry.pair();

if channel.name == name {
Expand Down

0 comments on commit 45b39ea

Please sign in to comment.