Skip to content

Commit bf3444c

Browse files
committed
clippy: fixes of Rust 2024 edition
1 parent 0da58fe commit bf3444c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

multiboot2-header/src/header.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::{
44
HeaderTagType, InformationRequestHeaderTag, ModuleAlignHeaderTag, RelocatableHeaderTag,
55
TagIter,
66
};
7-
use core::error::Error;
87
use core::fmt::{Debug, Formatter};
98
use core::mem::size_of;
109
use core::ptr::NonNull;
@@ -38,7 +37,7 @@ impl<'a> Multiboot2Header<'a> {
3837
/// Multiboot2 header pointer.
3938
pub unsafe fn load(ptr: *const Multiboot2BasicHeader) -> Result<Self, LoadError> {
4039
let ptr = NonNull::new(ptr.cast_mut()).ok_or(LoadError::Memory(MemoryError::Null))?;
41-
let inner = DynSizedStructure::ref_from_ptr(ptr).map_err(LoadError::Memory)?;
40+
let inner = unsafe { DynSizedStructure::ref_from_ptr(ptr).map_err(LoadError::Memory)? };
4241
let this = Self(inner);
4342

4443
let header = this.0.header();

multiboot2/src/boot_information.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl<'a> BootInformation<'a> {
102102
/// program may observe unsynchronized mutation.
103103
pub unsafe fn load(ptr: *const BootInformationHeader) -> Result<Self, LoadError> {
104104
let ptr = NonNull::new(ptr.cast_mut()).ok_or(LoadError::Memory(MemoryError::Null))?;
105-
let inner = DynSizedStructure::ref_from_ptr(ptr).map_err(LoadError::Memory)?;
105+
let inner = unsafe { DynSizedStructure::ref_from_ptr(ptr).map_err(LoadError::Memory)? };
106106

107107
let this = Self(inner);
108108
if !this.has_valid_end_tag() {

0 commit comments

Comments
 (0)