is-same 0.2.0

A trait for comparing object equality.
Documentation

The is-same crate provides an IsSame trait which allows you to check if a value has changed from a previous version. This differs from PartialEq in two important ways:

  • Comparing NaNs with PartialEq will return false. IsSame will return true if they have identical bit patterns.
  • PartialEq does not assume two objects with referential equality are the same. IsSame is implemented for Rc ando ther common pointers.

The is-same-derive crate can be used to derive IsSame for your structs the same way as PartialEq:

use is_same_derive::IsSame;

#[derive(IsSame)]
struct MyStruct {
count: usize,
ch: char,
text: String,
}