-
-
Notifications
You must be signed in to change notification settings - Fork 181
uefi: use core::net-types in public API + remove duplications #1780
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
358a4c9
to
c0408f3
Compare
}; | ||
|
||
// Translate IP types back into the higher-level types. | ||
let fn_replace_ip = |core_ip: &mut Option<&mut IpAddr>, efi_ip: Option<EfiIpAddr>| { |
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.
Please note that this will be tested once #1785 is merged.
4634e0b
to
8e03354
Compare
uefi/src/proto/network/pxe.rs
Outdated
let fn_replace_ip = |core_ip: &mut Option<&mut IpAddr>, efi_ip: Option<EfiIpAddr>| { | ||
// TODO use let-chain once we are on MSRV 1.88 | ||
if let Some(core_ip_location) = core_ip { | ||
if let Some(efi_ip) = efi_ip { |
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.
Nit: could do if let (Some(core_ip_location), Some(efi_ip)) = (core_ip, efi_ip) {
. Not sure if that's particularly more or less clear than if-let-chains.
Please note that some structs that are low-level types and UEFI-facing still use EfiIpAddr instead. This includes for example ```rust /// This struct contains optional parameters for [`BaseCode::discover`]. /// /// Corresponds to the `EFI_PXE_BASE_CODE_DISCOVER_INFO` type in the C API. #[repr(C)] #[derive(Debug, Pointee)] pub struct DiscoverInfo { use_m_cast: bool, use_b_cast: bool, use_u_cast: bool, must_use_list: bool, server_m_cast_ip: EfiIpAddr, ip_cnt: u16, srv_list: [Server], } ``` Once #1642 is resolved, this can be improved.
Otherwise, some users have to also pull in uefi-raw in a matching version as dependency. We however want to prevent a mix use in public API. See [0] for context. [0] https://rust-osdev.zulipchat.com/#narrow/channel/426438-uefi-rs/topic/Re-export.20.60uefi-raw.60.20from.20.60uefi.60.3F/near/545022347
FYI: Some types still in the |
This is the final step of #1575, after many pre-requisites have been merged recently.
Closes #1575
Checklist