Crates.io | enum-procs |
lib.rs | enum-procs |
version | 0.2.0 |
source | src |
created_at | 2024-04-15 11:13:15.064862 |
updated_at | 2024-04-15 16:39:55.139597 |
description | Procedural macros for enums. |
homepage | |
repository | https://github.com/artegoser/enum-procs |
max_upload_size | |
id | 1209132 |
size | 7,517 |
Rust macros for enums
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));