Skip to content

Conversation

@vilgotf
Copy link
Member

@vilgotf vilgotf commented Dec 31, 2025

These convenience implementations bring a better developer experience. This PR also features some cleanup with struct field/enum variant sorting

@github-actions github-actions bot added c-model Affects the model crate c-util Affects the util crate t-feature Addition of a new feature labels Dec 31, 2025
User(Id<UserMarker>),
}

impl CommandOptionValue {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SubCommand and SubCommandGroup have the same inner type, so no conversion implementations are provided

///
/// [`member`]: Self::member
/// [`user`]: Self::user
pub fn into_author(self) -> Option<User> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matching owned variant to author()


#[derive(Debug, Deserialize)]
#[serde(field_identifier, rename_all = "snake_case")]
enum Field {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not bother sorting its usage

command::{
Command, CommandOption, CommandOptionChoice, CommandOptionChoiceValue,
CommandOptionType, CommandOptionValue, CommandType,
CommandOptionType, CommandType,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied the provided From implementations

@vilgotf vilgotf added c-model Affects the model crate c-util Affects the util crate labels Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c-model Affects the model crate c-util Affects the util crate t-feature Addition of a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants