Skip to content

Commit 1aa3d58

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 1aa3d58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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_event(&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)