Currently units::amount::Denomination does not implement PartialOrd or Ord. This prevents any type that includes a Denomination from being used in contexts that require these traits (e.g. as key to a BTreeMap). This is an unnecessary restriction. We should either implement the traits or implement ArbitraryOrd.
This raises the question - "should stable crates derive PartialOrd and Ord on enums"? Doing so locks us in to not being able to re-order the variants (which would otherwise be an internal refactor) because the derived impls use the enum integer value (0 for the first variant, 1 for the second etc).
Since we have ArbitraryOrd should we be using it for all enums? Or perhaps should we be manually implementing PartialOrd and Ord?
Currently
units::amount::Denominationdoes not implementPartialOrdorOrd. This prevents any type that includes aDenominationfrom being used in contexts that require these traits (e.g. as key to aBTreeMap). This is an unnecessary restriction. We should either implement the traits or implementArbitraryOrd.This raises the question - "should stable crates derive
PartialOrdandOrdon enums"? Doing so locks us in to not being able to re-order the variants (which would otherwise be an internal refactor) because the derived impls use the enum integer value (0 for the first variant, 1 for the second etc).Since we have
ArbitraryOrdshould we be using it for all enums? Or perhaps should we be manually implementingPartialOrdandOrd?