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
Additional error data in Result + some API cleanup and clarification #78
Conversation
- Replace Result<()> with Result - Use new facility for cleanly reporting error data - Fix a few incorrect APIs (bad lifetime, error/warning confusion) - Drop some usage of core::result::Result, qualify the rest better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the improvements to the error types. While these changes are extensive, it should be better in the long run.
I try to do this kind of API changes now so that we don't have to do them later, as the more UEFI entry points we have the more painful this exercise becomes (not to mention the impact on users, when we have more of them). It is also a good way for me to become more familiar with your work. Next things I'd like to work on:
|
This PR fixes #70 by adding support for additional error data to our Result type. As a result, usage of raw
core::result::Result
can now be restricted to functions which do not call into UEFI.Since most functions do not return additional error data, the associated type parameter is optional with a default of
()
. After some thought, I think that the main output should probably get the same treatment, as a large amount of "setter" UEFI functions do not emit anything more than a status code.While I went around the codebase to tweak every API entry point definition accordingly, I noticed a couple of issues here and there. Some entry points were in minor disagreement with the spec's semantics, while others did something wrong and dangerous. I'll clarify those changes as PR comments.
As I noticed some lifetime errors among these, I thought now might be a good time to use clearer lifetime parameter names in order to clarify the semantics of lifetime-based code. Result's generic parameters also got the same treatment.