From 5fdea76f377f9b702606d64e24c9c6634665bcdc Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Fri, 3 Apr 2026 06:02:50 -0300 Subject: [PATCH] Fix more linter warnings --- src/groups/calls/commands.rs | 26 ++++++++++++-------------- src/utils.rs | 4 ++-- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/groups/calls/commands.rs b/src/groups/calls/commands.rs index 6f5f635..0714b64 100644 --- a/src/groups/calls/commands.rs +++ b/src/groups/calls/commands.rs @@ -599,27 +599,25 @@ impl Command for MaskCommand { if let Some(channel) = channel && let Some(call_id) = channel.call_id - { - if let Some(mut participant) = Participant::get_for_user_and_channel_in_call( + && let Some(mut participant) = Participant::get_for_user_and_channel_in_call( ctx.extras.user.id, ctx.event.channel_id.get(), call_id, &ctx.rt.state.db, ) .await? - { - participant.is_masked = ctx.extras.user.is_masked; - participant.upsert(&ctx.rt.state.db).await?; + { + participant.is_masked = ctx.extras.user.is_masked; + participant.upsert(&ctx.rt.state.db).await?; - if ctx.extras.user.is_masked { - mask_message = format!( - "🎭 Your mask {mask_verb} set to `on`. You're currently being displayed as **{} {}**. You can toggle your mask on or off using `{}mask on` and `{}mask off`.", - get_mask_emoji(&participant.user_mask).expect("User's mask did not exist"), - get_mask_display_name(&participant.user_mask), - ctx.prefix, - ctx.prefix - ); - } + if ctx.extras.user.is_masked { + mask_message = format!( + "🎭 Your mask {mask_verb} set to `on`. You're currently being displayed as **{} {}**. You can toggle your mask on or off using `{}mask on` and `{}mask off`.", + get_mask_emoji(&participant.user_mask).expect("User's mask did not exist"), + get_mask_display_name(&participant.user_mask), + ctx.prefix, + ctx.prefix + ); } } diff --git a/src/utils.rs b/src/utils.rs index 116672e..9e808b6 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -111,9 +111,9 @@ pub fn u64_to_i64(u: u64) -> i64 { /// Returns: /// [`Option<(&str, &str)>`] - The splitted parts of the string, or [`None`] if no occurrences of /// `pattern` were found in `s`. -pub fn split_at_nth_from_end<'a, 'b>( +pub fn split_at_nth_from_end<'a>( s: &'a str, - pattern: &'b str, + pattern: &str, n: usize, ) -> Option<(&'a str, &'a str)> { let mut end = s.len();