Equality in rust is value equality per default, that’s what these traits are for. If you want to check pointer equality you’d use the std::ptr::eq function to check if two pointers are equal, which is rather rare in practice. You can also implement the PartialEq trait yourself if you need custom equality checks.
Equality in rust is value equality per default, that’s what these traits are for. If you want to check pointer equality you’d use the
std::ptr::eq
function to check if two pointers are equal, which is rather rare in practice. You can also implement thePartialEq
trait yourself if you need custom equality checks.