File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ use crate::proto::{ProtocolPointer, unsafe_protocol};
111111use core:: ffi:: c_void;
112112use core:: fmt:: { self , Debug , Display , Formatter } ;
113113use core:: ops:: Deref ;
114+ use core:: ptr;
114115use ptr_meta:: Pointee ;
115116use 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.
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments