-
-
Notifications
You must be signed in to change notification settings - Fork 169
uefi-raw: unified boolean type #1307
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
Conversation
So this ends up being similar to enums, where we carefully construct wrappers with |
I've come up with a new design. What do you think? Open Question:
|
I think this design looks good.
Yes, I think loosening the requirements so that any non-zero value is treated as
I feel that it does. For example, with the field In this particular case, I think the easiest thing to do is to change the definition to |
ab54a33
to
483dee0
Compare
This way we can be ABI-compatible and guarantee lack of UB, while being more precise in interfaces.
fed3cee
to
95e4c16
Compare
This aligns the behaviour with r_efi [0]. [0] https://docs.rs/r-efi/5.1.0/src/r_efi/base.rs.html#488
pub const fn is_removable_media(&self) -> bool { | ||
self.0.removable_media | ||
pub fn is_removable_media(&self) -> bool { | ||
// Panic: Misbehaving UEFI impls are so unlikely; just fail |
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.
Can drop all the panic comments in this file too
Closing in favor of #1536 |
This streamlines the existing usages of
u8
andbool
. Note thatBootPolicy
from #1297 is seamlessly integrated intou8
andbool
.Steps to Undraft
Checklist