Skip to content

Guarantee NonZero, NonMax have same Ord, Hash as underlying type

Choose a tag to compare

@Techcable Techcable released this 03 Sep 22:08
772196c

Make Hash impl for NonMax satisfy this property.
All other trait implementations already satisfied this.

Changed

  • Officially guarantee that NonMax<T> and NonZero<T> implement Hash the same as T (zoxoyvnx)
  • Similarly guarantee that NonMax<T> and NonZero<T> implement Ord the same as T (lzlwsrtp)
    • This has always been the case for both types.

Fixes

  • The Hash impl for NonMax now behaves the same as the underlying type T. (ppmqkvzx)
    • This property has always been true of NonZero, but has not been true for NonMax