Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
evanc577 committed Sep 15, 2023
1 parent 2e7841a commit 892e58b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/patchbot_forwarder/forwarder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub async fn forward(
let embed = message
.embeds
.iter()
.filter(|e| {
.find(|e| {
if let Some(author) = &e.author {
!author
.name
Expand All @@ -26,7 +26,6 @@ pub async fn forward(
false
}
})
.next()
.ok_or(PatchbotForwardError::InvalidEmbeds)?;
let embed_author = embed
.author
Expand All @@ -40,8 +39,7 @@ pub async fn forward(
.filter(Column::GuildId.eq(format!(
"{:x}",
message
.guild_id
.and_then(|x| Some(*x.as_u64()))
.guild_id.map(|x| *x.as_u64())
.unwrap_or(0)
)))
.filter(Column::SourceChannelId.eq(format!("{:x}", message.channel_id.as_u64())))
Expand Down
2 changes: 1 addition & 1 deletion src/patchbot_forwarder/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub async fn insert_to_table(
let x = ActiveModel {
guild_id: Set(format!(
"{:x}",
ctx.guild_id().and_then(|x| Some(*x.as_u64())).unwrap_or(0)
ctx.guild_id().map(|x| *x.as_u64()).unwrap_or(0)
)),
source_channel_id: Set(format!("{:x}", source_channel_id)),
match_text: Set(match_text.to_owned()),
Expand Down

0 comments on commit 892e58b

Please sign in to comment.