Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derive PartialOrd/Ord/PartialEq for more types #6

Closed
NickCondron opened this issue Jun 22, 2022 · 1 comment
Closed

Derive PartialOrd/Ord/PartialEq for more types #6

NickCondron opened this issue Jun 22, 2022 · 1 comment

Comments

@NickCondron
Copy link
Contributor

NickCondron commented Jun 22, 2022

A couple times using this library I've expected a trait to be implemented for a type when it wasn't. For example the Port type in src/model/primitives.rs doesn't implement PartialOrd/Ord, so trying to compare the port of two players to determine which comes first in the Frame<N> struct is tedious.

I don't know when ParitalOrd is sufficient or when you want PartialOrd & Ord. Same goes with ParitalEq and Eq. Seems like some types have just PartialEq when they could also have Eq. I don't know if there's a rhyme or reason why things are the way they are.

See also: https://rust-lang.github.io/api-guidelines/interoperability.html#c-common-traits

I'd be willing to go through and add some of these to the derive statements, but it would help to hear your input.

@hohav
Copy link
Owner

hohav commented Aug 21, 2022

Closed by 8f81021 & 961d95b. FYI there are a few structs that still don't implement Eq because they contain floats, which are PartialEq but not Eq.

@hohav hohav closed this as completed Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants