Skip to content

Commit

Permalink
Apply suggestions from clippy (serenity-rs#2538)
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev authored and mkrasnitski committed Oct 24, 2023
1 parent 8ce44cb commit 1622542
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/cache/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,8 @@ impl CacheUpdate for MessageCreateEvent {
return None;
}

let mut messages =
cache.messages.entry(self.message.channel_id).or_insert_with(Default::default);
let mut queue =
cache.message_queue.entry(self.message.channel_id).or_insert_with(Default::default);
let mut messages = cache.messages.entry(self.message.channel_id).or_default();
let mut queue = cache.message_queue.entry(self.message.channel_id).or_default();

let mut removed_msg = None;

Expand Down
2 changes: 1 addition & 1 deletion src/framework/standard/help_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ async fn fetch_single_command<'a>(
owners,
)
.await
.map_err(|_| similar_commands)
.map_err(|()| similar_commands)
}

#[cfg(feature = "cache")]
Expand Down
2 changes: 1 addition & 1 deletion src/framework/standard/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ async fn check_discrepancy(
}

fn try_parse<M: ParseMap>(
stream: &mut Stream<'_>,
stream: &Stream<'_>,
map: &M,
by_space: bool,
f: impl Fn(&str) -> String,
Expand Down
2 changes: 1 addition & 1 deletion src/http/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl Typing {
spawn_named::<_, Result<_>>("typing::start", async move {
loop {
match rx.try_recv() {
Ok(_) | Err(TryRecvError::Closed) => break,
Ok(()) | Err(TryRecvError::Closed) => break,
_ => (),
}

Expand Down

0 comments on commit 1622542

Please sign in to comment.