I have the following enum:
enum Foo {
Foo(u8),
Bar(u8),
Baz(u8)
}
I'd like to implement ParitalOrd such that Foo(x) == Bar(x) == Baz(x)
, but for x > y > z
, Foo(x) > Bar(y) > Baz(z)
. What is the appropriate syntax for implementing that?
This seems to work for the question I've asked but my program is not working correctly, so I guess I have an X/Y problem to figure out.
Uggh. Was sorting on wrong field of struct. The playground link works for my purposes but advice on improvements to the methods are welcome.