dyn_partial_eq
PartialEq for trait objects
This crate provides macros for deriving PartialEq for Box<dyn Trait>
, removing the boilerplate of having to provide your own implementations. Inspired by this blog post: https://dev.to/magnusstrale/rust-trait-objects-in-a-vector-non-trivial-4co5
Add the crate to your project:
use *;
// Use this to add a DynPartialEq supertrait and implement PartialEq for your trait.
// Derive DynPartialEq and PartialEq on your types that implement your trait.
;
);
And voila:
let boxed_a_zero: = Box new;
let boxed_a_one: = Box new;
let boxed_b: = Box new;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;