#Combine multiple Macros into one?

1 messages · Page 1 of 1 (latest)

grave parrot
#

I have the following code:

#[derive(FromPrimitive, ToPrimitive, Clone, Copy, EnumCount, EnumIter, Default)]
pub enum FrequencyType {
    Hertz,
    #[default]
    Milliseconds,
}

It works great, but the number of "derive" traits is just way too long.
Is there a way to create a custom Macro, which combines all these Macros into one?

smoky halo
#

To my knowledge, not without making your own proc macro, which is... a lot of effort (it's a whole separate crate)

sharp anvil
smoky halo
#

Oh, neat

wet star
#

?crate derive-alias

muted axleBOT
#

Alias multiple derives as one.

Version

0.1.0

Downloads

6 321