derive-for

Crates.ioderive-for
lib.rsderive-for
version1.2.2
sourcesrc
created_at2021-09-25 22:08:23.735699
updated_at2021-09-25 22:40:48.710514
descriptionMacro for defining structs using the same derive procedural macros
homepage
repositoryhttps://github.com/ten3roberts/derive-for
max_upload_size
id456315
size5,244
Freja Roberts (ten3roberts)

documentation

https://docs.rs/derive_for

README

derive-for

A macro for defining multiple structs using the same derive procedures.

The most common use case is in combination with the derive_more for using the same derives to create transparent newtypes.

Usage

derive_for!(
( Clone, Debug, PartialEq, Eq),
pub struct Foo{a: i32, name: String};
pub struct Bar(u32, u32);
);

Clone, Debug, PartialEq, and Eq will now be implemented for both Foo and Bar. If deriving many traits for many newtypes this significantly shortens the code.

State

This crate is very small and feature complete. If there are any issues, feel free to open an issue.

Commit count: 6

cargo fmt