diff --git a/src/discord/commands/create_tag.rs b/src/discord/commands/create_tag.rs index 3e1d15c..b454fd1 100644 --- a/src/discord/commands/create_tag.rs +++ b/src/discord/commands/create_tag.rs @@ -56,7 +56,7 @@ impl BotCommand for CreateTagCommand { database: Arc, ) -> Result<(), CommandExecutionError> { // 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(r) => match r { CommandDataOptionValue::String(r_str) => Ok(r_str), diff --git a/src/discord/commands/delete_tag.rs b/src/discord/commands/delete_tag.rs index be74257..bb9dab2 100644 --- a/src/discord/commands/delete_tag.rs +++ b/src/discord/commands/delete_tag.rs @@ -55,7 +55,7 @@ impl BotCommand for DeleteTagCommand { context: Context, database: Arc, ) -> 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(r) => match r { CommandDataOptionValue::String(r_str) => Ok(r_str), diff --git a/src/discord/message_builders/selector_builder.rs b/src/discord/message_builders/selector_builder.rs index 2f0e4b3..3d804ca 100644 --- a/src/discord/message_builders/selector_builder.rs +++ b/src/discord/message_builders/selector_builder.rs @@ -64,10 +64,7 @@ impl<'a> EmbedSelector<'a> { selectable: Vec, initial_selection: Option>, ) -> Self { - let selection = match initial_selection { - Some(r) => r, - None => HashSet::new(), - }; + let selection = initial_selection.unwrap_or_default(); let mut selector = EmbedSelector { interaction,