Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
- `clippy::no_effect_underscore_binding`
- `clippy::unnecessary_fallible_conversions`
  • Loading branch information
nickelc committed Jan 2, 2024
1 parent d14c980 commit 82f98e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/commands/subs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down Expand Up @@ -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)?;
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
clippy::wildcard_imports
)]

use std::convert::Infallible;
use std::path::PathBuf;

use dotenv::dotenv;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 82f98e1

Please sign in to comment.