Skip to content

Commit 1b06a3b

Browse files
Fix new clippy lints
1 parent d318a25 commit 1b06a3b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

uefi/src/proto/device_path/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ use crate::proto::{ProtocolPointer, unsafe_protocol};
111111
use core::ffi::c_void;
112112
use core::fmt::{self, Debug, Display, Formatter};
113113
use core::ops::Deref;
114+
use core::ptr;
114115
use ptr_meta::Pointee;
115116
use uefi_raw::protocol::device_path::DevicePathProtocol;
116117
#[cfg(feature = "alloc")]
@@ -551,8 +552,7 @@ impl DevicePath {
551552
/// Cast to a [`FfiDevicePath`] pointer.
552553
#[must_use]
553554
pub const fn as_ffi_ptr(&self) -> *const FfiDevicePath {
554-
let p = self as *const Self;
555-
p.cast()
555+
ptr::from_ref(self).cast()
556556
}
557557

558558
/// Get an iterator over the [`DevicePathInstance`]s in this path.

uefi/src/proto/rng.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Rng {
5252

5353
let algo = match algorithm.as_ref() {
5454
None => ptr::null(),
55-
Some(algo) => algo as *const RngAlgorithmType,
55+
Some(algo) => ptr::from_ref(algo),
5656
};
5757

5858
unsafe {

0 commit comments

Comments
 (0)