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

Rename TryFrom's associated type and implement str::parse using TryFrom. #40281

Merged
merged 1 commit into from
Mar 20, 2017
Merged

Rename TryFrom's associated type and implement str::parse using TryFrom. #40281

merged 1 commit into from
Mar 20, 2017

Commits on Mar 15, 2017

  1. Rename TryFrom's associated type and implement str::parse using TryFrom.

    Per discussion on the tracking issue, naming `TryFrom`'s associated type
    `Error` is generally more consistent with similar traits in the Rust
    ecosystem, and what people seem to assume it should be called. It
    also helps disambiguate from `Result::Err`, the most common "Err".
    
    See
    #33417 (comment).
    
    TryFrom<&str> and FromStr are equivalent, so have the latter provide the
    former to ensure that. Using TryFrom in the implementation of
    `str::parse` means types that implement either trait can use it.
    When we're ready to stabilize `TryFrom`, we should update `FromStr` to
    suggest implementing `TryFrom<&str>` instead for new code.
    
    See
    #33417 (comment)
    and
    #33417 (comment).
    
    Refs #33417.
    jimmycuadra authored and alexcrichton committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    2561dcd View commit details
    Browse the repository at this point in the history