Skip to content

Commit 3178ccb

Browse files
committed
clippy: fixes of Rust 2024 edition
1 parent 56af330 commit 3178ccb

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;
@@ -39,7 +38,7 @@ impl<'a> Multiboot2Header<'a> {
3938
/// Multiboot2 header pointer.
4039
pub unsafe fn load(ptr: *const Multiboot2BasicHeader) -> Result<Self, LoadError> {
4140
let ptr = NonNull::new(ptr.cast_mut()).ok_or(LoadError::Memory(MemoryError::Null))?;
42-
let inner = DynSizedStructure::ref_from_ptr(ptr).map_err(LoadError::Memory)?;
41+
let inner = unsafe { DynSizedStructure::ref_from_ptr(ptr).map_err(LoadError::Memory)? };
4342
let this = Self(inner);
4443

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

multiboot2/src/boot_information.rs

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

9999
let this = Self(inner);
100100
if !this.has_valid_end_tag() {

0 commit comments

Comments
 (0)