Skip to content

Refactor to use TryFrom #85

Open
Open
@hawkw

Description

@hawkw

Since the TryFrom trait is in unstable Rust (rust-lang/rust#33417), we should rewrite a lot of failable conversions into TryFrom implementations. For example, a lot of the ELF parsing code that returns Result<Self, ElfError> can probably be rewritten to use TryFrom.

Where removing existing failable conversion methods would break a lot of other code, we can temporarily preserve the existing API by having it wrap a try_from call, and phase it out gradually.

We don't have to worry about TryFrom not being on stable, since we can't build SOS on stable anyway.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contrib/easyContributing: this issue likely requires less time or experience than other issues.contrib/good first issueContributing: this issue would make a good starting point for a first-time contributor.kind/refactorKind: this issue describes refactoring or code quality improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions