Skip to content

Commit d417cd1

Browse files
authored
Merge pull request #1908 from rust-osdev/push-rylwqsolvvxk
Fix new clippy lints
2 parents 0466c50 + 1b06a3b commit d417cd1

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")]
@@ -564,8 +565,7 @@ impl DevicePath {
564565
/// Cast to a [`FfiDevicePath`] pointer.
565566
#[must_use]
566567
pub const fn as_ffi_ptr(&self) -> *const FfiDevicePath {
567-
let p = self as *const Self;
568-
p.cast()
568+
ptr::from_ref(self).cast()
569569
}
570570

571571
/// 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)