refact(action)

This commit is contained in:
steven-omaha
2023-05-23 13:11:49 +02:00
parent 87569de3c9
commit 79c9e51e8c
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
use pacdef_macros::Action; use pacdef_macros::Action;
/// All actions the program can perform. Variants of the enum relate to /// All main actions the program can perform. Variants of the enum relate to
/// the different subcommands. /// the different subcommands.
#[derive(Debug, Action)] #[derive(Debug, Action)]
pub enum Actions { pub enum Actions {
+2 -1
View File
@@ -63,7 +63,8 @@ where
{ {
let expanded = quote! { let expanded = quote! {
impl #name { impl #name {
pub const fn name(&self) -> &'static str { /// Return the lowercase name of the enum variant as `&str`.
const fn name(&self) -> &'static str {
match self { match self {
#(#variant_description)* #(#variant_description)*
} }