Skip to content

Commit 6240743

Browse files
authored
Merge pull request #974 from nicholasbishop/bishop-remove-nonnull
uefi-services: Remove NonNull wrapper from system_table
2 parents 3ae65f6 + 2e58314 commit 6240743

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
## uefi-services - [Unreleased]
1717

18+
### Changed
19+
- `uefi_services::system_table` now returns `SystemTable<Boot>` directly, rather
20+
than wrapped in a `NonNull` pointer.
21+
1822
## uefi - 0.25.0 (2023-10-10)
1923

2024
### Changed

uefi-services/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ static mut LOGGER: Option<uefi::logger::Logger> = None;
6565
///
6666
/// The returned pointer is only valid until boot services are exited.
6767
#[must_use]
68-
pub fn system_table() -> NonNull<SystemTable<Boot>> {
68+
pub fn system_table() -> SystemTable<Boot> {
6969
unsafe {
7070
let table_ref = SYSTEM_TABLE
7171
.as_ref()
7272
.expect("The system table handle is not available");
73-
NonNull::new(table_ref as *const _ as *mut _).unwrap()
73+
table_ref.unsafe_clone()
7474
}
7575
}
7676

0 commit comments

Comments
 (0)