File tree 4 files changed +5
-4
lines changed
4 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ trait InfoInternal: Align + ptr_meta::Pointee<Metadata = usize> {
68
68
{
69
69
// Calculate the final size of the struct.
70
70
let name_length_ucs2 = name. as_slice_with_nul ( ) . len ( ) ;
71
- let name_size = name_length_ucs2 * mem:: size_of :: < Char16 > ( ) ;
71
+ let name_size = mem:: size_of_val ( name . as_slice_with_nul ( ) ) ;
72
72
let info_size = Self :: name_offset ( ) + name_size;
73
73
let info_size = Self :: round_up_to_alignment ( info_size) ;
74
74
Original file line number Diff line number Diff line change @@ -680,7 +680,7 @@ impl DiscoverInfo {
680
680
let required_size = core:: mem:: size_of :: < bool > ( ) * 4
681
681
+ core:: mem:: size_of :: < IpAddress > ( )
682
682
+ core:: mem:: size_of :: < u16 > ( )
683
- + core:: mem:: size_of :: < Server > ( ) * server_count ;
683
+ + core:: mem:: size_of_val ( srv_list ) ;
684
684
685
685
if buffer. len ( ) < required_size {
686
686
return Err ( Status :: BUFFER_TOO_SMALL . into ( ) ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ impl Rng {
17
17
& mut self ,
18
18
algorithm_list : & ' buf mut [ RngAlgorithmType ] ,
19
19
) -> Result < & ' buf [ RngAlgorithmType ] , Option < usize > > {
20
- let mut algorithm_list_size = algorithm_list . len ( ) * mem:: size_of :: < RngAlgorithmType > ( ) ;
20
+ let mut algorithm_list_size = mem:: size_of_val ( algorithm_list ) ;
21
21
22
22
unsafe {
23
23
( self . 0 . get_info ) (
Original file line number Diff line number Diff line change 1
- ///! Facilities for dealing with UEFI operation results.
1
+ //! Facilities for dealing with UEFI operation results.
2
+
2
3
use core:: fmt:: Debug ;
3
4
4
5
/// The error type that we use, essentially a status code + optional additional data
You can’t perform that action at this time.
0 commit comments