Fix clippy lints error

This commit is contained in:
Victor Mignot 2025-01-01 15:14:14 +01:00
parent dfe6967f37
commit d35c2771a6
Signed by: dala
SSH key fingerprint: SHA256:+3O9MhlDc2tJL0n+E+Myr7nL+74DP9AXdIXHmIqZTkY
3 changed files with 3 additions and 6 deletions

View file

@ -56,7 +56,7 @@ impl BotCommand for CreateTagCommand {
database: Arc<DatabaseClient>, database: Arc<DatabaseClient>,
) -> Result<(), CommandExecutionError> { ) -> Result<(), CommandExecutionError> {
// Extract tag_name parameter // Extract tag_name parameter
let tag_name = match self.interaction.data.options.get(0) { let tag_name = match self.interaction.data.options.first() {
Some(a) => match &a.resolved { Some(a) => match &a.resolved {
Some(r) => match r { Some(r) => match r {
CommandDataOptionValue::String(r_str) => Ok(r_str), CommandDataOptionValue::String(r_str) => Ok(r_str),

View file

@ -55,7 +55,7 @@ impl BotCommand for DeleteTagCommand {
context: Context, context: Context,
database: Arc<DatabaseClient>, database: Arc<DatabaseClient>,
) -> Result<(), CommandExecutionError> { ) -> Result<(), CommandExecutionError> {
let tag_name = match self.interaction.data.options.get(0) { let tag_name = match self.interaction.data.options.first() {
Some(a) => match &a.resolved { Some(a) => match &a.resolved {
Some(r) => match r { Some(r) => match r {
CommandDataOptionValue::String(r_str) => Ok(r_str), CommandDataOptionValue::String(r_str) => Ok(r_str),

View file

@ -64,10 +64,7 @@ impl<'a> EmbedSelector<'a> {
selectable: Vec<String>, selectable: Vec<String>,
initial_selection: Option<HashSet<String>>, initial_selection: Option<HashSet<String>>,
) -> Self { ) -> Self {
let selection = match initial_selection { let selection = initial_selection.unwrap_or_default();
Some(r) => r,
None => HashSet::new(),
};
let mut selector = EmbedSelector { let mut selector = EmbedSelector {
interaction, interaction,