-
Notifications
You must be signed in to change notification settings - Fork 17
Refactor to use TryFrom #85
Copy link
Copy link
Open
Labels
contrib/easyContributing: this issue likely requires less time or experience than other issues.Contributing: 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.Contributing: this issue would make a good starting point for a first-time contributor.kind/refactorKind: this issue describes refactoring or code quality improvement.Kind: this issue describes refactoring or code quality improvement.
Metadata
Metadata
Assignees
Labels
contrib/easyContributing: this issue likely requires less time or experience than other issues.Contributing: 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.Contributing: this issue would make a good starting point for a first-time contributor.kind/refactorKind: this issue describes refactoring or code quality improvement.Kind: this issue describes refactoring or code quality improvement.
Since the
TryFromtrait is in unstable Rust (rust-lang/rust#33417), we should rewrite a lot of failable conversions intoTryFromimplementations. For example, a lot of the ELF parsing code that returnsResult<Self, ElfError>can probably be rewritten to useTryFrom.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_fromcall, and phase it out gradually.We don't have to worry about
TryFromnot being on stable, since we can't build SOS on stable anyway.