Skip to content

Commit e587b21

Browse files
committed
Change SimpleNetwork::wait_for_packet to return Option<Event>
A reference to an `Event` is useless since every api takes an `&mut Event`, now we return the `Event` by value.
1 parent 159f825 commit e587b21

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

uefi/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
## Changed
1111
- Changed ordering of `proto::pci::PciIoAddress` to (bus -> dev -> fun -> reg -> ext_reg).
1212
- Return request with status as error data object for `proto::ata::pass_thru::AtaDevice`.
13+
- **Breaking:** `proto::network::snp::SimpleNetwork::wait_for_packet` now
14+
returns `Option<Event>` instead of `&Event`.
1315

1416
# uefi - v0.36.1 (2025-11-05)
1517

uefi/src/proto/network/snp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ impl SimpleNetwork {
270270
/// On QEMU, this event seems to never fire; it is suggested to verify that your implementation
271271
/// of UEFI properly implements this event before using it.
272272
#[must_use]
273-
pub const fn wait_for_packet(&self) -> &Event {
274-
unsafe { &*(ptr::from_ref(&self.0.wait_for_packet).cast::<Event>()) }
273+
pub fn wait_for_packet(&self) -> Option<Event> {
274+
unsafe { Event::from_ptr(self.0.wait_for_packet) }
275275
}
276276

277277
/// Returns a reference to the Simple Network mode.

0 commit comments

Comments
 (0)