derive-alias

Crates.ioderive-alias
lib.rsderive-alias
version0.1.1
sourcesrc
created_at2021-04-08 21:46:56.142474
updated_at2024-11-30 19:46:06.095171
descriptionAlias multiple derives as one.
homepage
repositoryhttps://github.com/ibraheemdev/derive-alias
max_upload_size
id381045
size7,326
Ibraheem Ahmed (ibraheemdev)

documentation

README

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; }
Commit count: 7

cargo fmt