Newbie misread Eq Trait
⚓ Rust 📅 2026-01-31 👤 surdeus 👁️ 11I am apparently misreading what the Eq trait does when I declare it to be derived on a struct. What I am trying to achieve is that an instance of the struct is equal to itself, but not equal to another instance even if all the fields are identical. I got that PartialEq would not do that. But when I tried adding Eq, it was still trying to apply it to the intdividual fields. Wo what is Eq trying to do? And how to do I get the goal I am after?
Thanks,
Joel
4 posts - 3 participants
🏷️ Rust_feed