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

refactor(LanguageIdentifier): Derive PartialOrd and Ord for LanguageIdentifier. #5295

Closed
wants to merge 2 commits into from

Conversation

JosiahBull
Copy link

Add Derive PartialOrd and Ord on the LanguageIdentifier type. Based on previous PRs it seems reasonably acceptable to add this implementation.

Happy to add this to other objects or make other changes if required. :)

@JosiahBull JosiahBull requested review from zbraniecki, nciric and a team as code owners July 25, 2024 01:16
@CLAassistant
Copy link

CLAassistant commented Jul 25, 2024

CLA assistant check
All committers have signed the CLA.

@Manishearth
Copy link
Member

Manishearth commented Jul 25, 2024

I believe this is a deliberate omission since there are multiple valid ways to compare these types (see: strict_cmp) and we don't want this to be a footgun.

cc @sffc @zbraniecki

@sffc
Copy link
Member

sffc commented Jul 25, 2024

See discussion in #1215.

Since ICU4X 1.5, we have a total_cmp function on these types that can be used to make a thin wrapper that implements PartialOrd/Ord for use in a BTreeMap.

@sffc sffc closed this Jul 25, 2024
@JosiahBull JosiahBull deleted the jo/add-ordering branch July 25, 2024 02:17
@JosiahBull
Copy link
Author

I appreciate the link to the previous discussion, thanks for being so polite!

Apologies for missing the previous PR removing this functionality in my initial search. 😅

@sffc
Copy link
Member

sffc commented Jul 25, 2024

Thanks for discovering that we lack documentation about this! Adding it here: #5296

sffc added a commit that referenced this pull request Jul 25, 2024
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.

4 participants