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

Add Ord on locale related structs #3588

Closed

Conversation

bbqsrc
Copy link

@bbqsrc bbqsrc commented Jun 27, 2023

Adds Ord to Locale related structs so a Locale can be used as a key in a BTreeMap.

@CLAassistant
Copy link

CLAassistant commented Jun 27, 2023

CLA assistant check
All committers have signed the CLA.

@sffc
Copy link
Member

sffc commented Jun 27, 2023

Hi! Please take a look at #1215

@bbqsrc
Copy link
Author

bbqsrc commented Jun 27, 2023

Okay, cool. I half expected this might be the case but couldn’t find it.

The problem is, it wasn’t resolved and instead simply removed. Lexicographical ordering of keys is sufficient, and adding subjective bias to what are ultimately string markers for a locale and its configuration is at the very least interesting but not particularly useful.

What is the path forward?

Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think that loc1.cmp(loc2) should equal loc1.to_string().cmp(loc2.to_string()). That's fairly easy for language identifiers and somewhat harder but not infeasible for extensions.

@bbqsrc
Copy link
Author

bbqsrc commented Jun 28, 2023

That is a path forward. 🙂

@sffc
Copy link
Member

sffc commented Jul 27, 2023

Closing for now, but we're still open to an Ord impl in accordance with the issues above.

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

Successfully merging this pull request may close these issues.

None yet

3 participants