Skip to content

Refactor: Extract function util::c_cmp_to_ordering #423

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

Merged
merged 2 commits into from
May 27, 2019

Conversation

emlun
Copy link
Contributor

@emlun emlun commented May 26, 2019

I noticed some repeated code, and also added a test for good measure.

@ehuss
Copy link
Contributor

ehuss commented May 27, 2019

Thanks!

@ehuss ehuss merged commit c29c88d into rust-lang:master May 27, 2019
@emlun emlun deleted the refactor-cmp branch May 27, 2019 20:42
@emlun
Copy link
Contributor Author

emlun commented May 27, 2019

You're welcome!

By the way, I also experimented a bit with adding a trait OrdC { fn c_cmp(...) -> c_int } and an impl<T: OrdC> Ord for T, but it seems like that's not allowed by Rust's orphan rules (it would work if Ord had been defined in this crate). If you have any ideas on how something like that could be doable, I'd be happy to experiment a bit more with it to see what happens.

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.

2 participants