Implement operator== and hashCode for Rect.