Skip to content

Commit b867467

Browse files
uefi: Change Pointer::wait_for_input_event to return an option
Our `Event` type always represents a non-null pointer, but the spec doesn't guarantee that the `wait_for_input` event will be non-null.
1 parent 10e3fe9 commit b867467

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Changed
66
- `Input::wait_for_key_event` now returns an `Option<Event>`, and is no longer `const`.
7+
- `Protocol::wait_for_input_event` now returns an `Option<Event>`.
78
- `LoadedImage::device` now returns an `Option<Handle>` and is no longer `const`.
89
- `BootServices::get_image_file_system` now returns
910
`ScopedProtocol<SimpleFileSystem>` instead of `fs::FileSystem`.

uefi/src/proto/console/pointer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{Event, Result, Status, StatusExt};
99
pub struct Pointer {
1010
reset: unsafe extern "efiapi" fn(this: &mut Pointer, ext_verif: bool) -> Status,
1111
get_state: unsafe extern "efiapi" fn(this: &Pointer, state: *mut PointerState) -> Status,
12-
wait_for_input: Event,
12+
wait_for_input: Option<Event>,
1313
mode: *const PointerMode,
1414
}
1515

@@ -46,7 +46,7 @@ impl Pointer {
4646
/// Event to be used with `BootServices::wait_for_event()` in order to wait
4747
/// for input from the pointer device
4848
#[must_use]
49-
pub const fn wait_for_input_event(&self) -> &Event {
49+
pub const fn wait_for_input_event(&self) -> &Option<Event> {
5050
&self.wait_for_input
5151
}
5252

0 commit comments

Comments
 (0)