๐Ÿ“ฆ ibraheemdev / derive-alias

Alias mutliple derives as one.

โ˜… 11 stars โ‘‚ 0 forks ๐Ÿ‘ 11 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/ibraheemdev/derive-alias.git
HTTPS git clone https://github.com/ibraheemdev/derive-alias.git
SSH git clone git@github.com:ibraheemdev/derive-alias.git
CLI gh repo clone ibraheemdev/derive-alias
Ibraheem Ahmed Ibraheem Ahmed release 0.1.1 518d8f8 1 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ Cargo.lock
๐Ÿ“„ Cargo.toml
๐Ÿ“„ LICENSE
๐Ÿ“„ README.md
๐Ÿ“„ README.md

derive-alias

crates.io github docs.rs

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; }