3 unstable releases

0.2.0 Apr 15, 2024
0.1.1 Apr 15, 2024
0.1.0 Apr 15, 2024

#458 in Procedural macros

MIT license

5KB
64 lines

enum-procs

Rust macros for enums

Usage

use enum_procs::PartialEqVariant;

#[derive(PartialEqVariant)]
enum EnumProc {
    VariantWithValue(bool),
    AnotherVariantWithValue(bool),
}

assert!(EnumProc::VariantWithValue(true) == EnumProc::VariantWithValue(false));
assert!(EnumProc::VariantWithValue(false) == EnumProc::VariantWithValue(true));

assert!(EnumProc::VariantWithValue(true) != EnumProc::AnotherVariantWithValue(false));
assert!(EnumProc::VariantWithValue(false) != EnumProc::AnotherVariantWithValue(true));

Dependencies

~310–770KB
~18K SLoC