refact(action)
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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)*
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user