From 82f98e1998ec52e16548e7059abc217d83f19968 Mon Sep 17 00:00:00 2001 From: Constantin Nickel Date: Mon, 1 Jan 2024 23:09:51 +0100 Subject: [PATCH] Fix clippy warnings - `clippy::no_effect_underscore_binding` - `clippy::unnecessary_fallible_conversions` --- src/commands/subs.rs | 4 ++-- src/main.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/subs.rs b/src/commands/subs.rs index ce15335..6b81a13 100644 --- a/src/commands/subs.rs +++ b/src/commands/subs.rs @@ -489,7 +489,7 @@ async fn mods( async fn mods_muted( ctx: &Context, interaction: &Interaction, - _opts: &[CommandDataOption], + _: &[CommandDataOption], ) -> Result<(), Error> { let channel_id = interaction.channel_id().unwrap(); let excluded = ctx.subscriptions.list_excluded_mods(channel_id)?; @@ -670,7 +670,7 @@ async fn users( async fn users_muted( ctx: &Context, interaction: &Interaction, - _opts: &[CommandDataOption], + _: &[CommandDataOption], ) -> Result<(), Error> { let channel_id = interaction.channel_id().unwrap(); let excluded = ctx.subscriptions.list_excluded_users(channel_id)?; diff --git a/src/main.rs b/src/main.rs index 9c43e26..8d2dd63 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,7 @@ clippy::wildcard_imports )] +use std::convert::Infallible; use std::path::PathBuf; use dotenv::dotenv; @@ -65,7 +66,7 @@ async fn try_main() -> CliResult { } let path = args - .opt_value_from_os_str("-c", |s| PathBuf::try_from(s))? + .opt_value_from_os_str("-c", |s| Ok::<_, Infallible>(PathBuf::from(s)))? .unwrap_or_else(|| PathBuf::from("bot.toml")); let config = config::load_from_file(&path)