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 impl From<Ordering> for i32 #89491

Closed
wants to merge 1 commit into from
Closed

Add impl From<Ordering> for i32 #89491

wants to merge 1 commit into from

Commits on Oct 3, 2021

  1. Add impl From<Ordering> for i32

    This commit adds a first-class `From` conversion of `Ordering` into
    `i32`.
    
    `Ordering` is defined to be compatible with the return types of the
    various `...cmp...` routines in the C standard library, but the only way
    to convert an `Ordering` to an `i32` is with a non-obvious `as` cast.
    
    This commit adds a proper API for doing this and hides a "scary" `as`
    cast inside the `core` library.
    lopopolo committed Oct 3, 2021
    Configuration menu
    Copy the full SHA
    a8a9336 View commit details
    Browse the repository at this point in the history