1 unstable release

0.1.0 Apr 8, 2021

#2009 in Rust patterns

Download history 14/week @ 2023-10-21 14/week @ 2023-10-28 12/week @ 2023-11-04 19/week @ 2023-11-11 12/week @ 2023-11-18 16/week @ 2023-11-25 9/week @ 2023-12-02 13/week @ 2023-12-09 10/week @ 2023-12-16 11/week @ 2023-12-23 7/week @ 2023-12-30 13/week @ 2024-01-06 12/week @ 2024-01-13 14/week @ 2024-01-20 39/week @ 2024-01-27 10/week @ 2024-02-03

76 downloads per month
Used in helius-sdk

MIT license

5KB
55 lines

Derive Alias

Documentation Version License Actions

Provides a way to alias mutliple derives as one:

use derive_alias::derive_alias;

// Generates a macro (`derive_cmp`) that will attach the listed derives to a given item
derive_alias! {
    derive_cmp => #[derive(Eq, PartialEq, Ord, PartialOrd)]
}

// Attach the derives to `Foo`
derive_cmp! { struct Foo; }

You can create multiple aliases at a time:

use derive_alias::derive_alias;

derive_alias! {
    derive_cmp => #[derive(Eq, PartialEq, Ord, PartialOrd)],
    derive_other => #[derive(Copy, Clone)]
}

derive_cmp! { struct Foo; }
derive_other! { struct Bar; }

No runtime deps