Skip to content

Wright-Language-Developers/multi-eq-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multi_eq

multi_eq is a macro library for creating custom equality trait derives.

/// Custom comparison trait `CustomEq` with a method `custom_eq`
multi_eq_make_trait!(CustomEq, custom_eq);

#[derive(CustomEq)]
struct MyStruct {
  // Use `PartialEq` to compare this field
  #[custom_eq(cmp = "eq")]
  a: u32,

  // Ignore value of this field when checking equality
  #[custom_eq(ignore)]
  b: bool,
}

For more information, see the documentation.