File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed
Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -457,20 +457,20 @@ impl Cmdline {
457457 const MB_MULT : u64 = KB_MULT << 10 ;
458458 const GB_MULT : u64 = MB_MULT << 10 ;
459459
460- if size % GB_MULT == 0 {
460+ if size. is_multiple_of ( GB_MULT ) {
461461 return format ! ( "{}G" , size / GB_MULT ) ;
462462 }
463- if size % MB_MULT == 0 {
463+ if size. is_multiple_of ( MB_MULT ) {
464464 return format ! ( "{}M" , size / MB_MULT ) ;
465465 }
466- if size % KB_MULT == 0 {
466+ if size. is_multiple_of ( KB_MULT ) {
467467 return format ! ( "{}K" , size / KB_MULT ) ;
468468 }
469469 size. to_string ( )
470470 }
471471
472472 fn check_outside_double_quotes ( slug : & str ) -> bool {
473- slug. matches ( '\"' ) . count ( ) % 2 == 0
473+ slug. matches ( '\"' ) . count ( ) . is_multiple_of ( 2 )
474474 }
475475
476476 /// Tries to build a [`Cmdline`] with a given capacity from a [`str`]. The format of the
Original file line number Diff line number Diff line change @@ -118,8 +118,8 @@ pub trait BootConfigurator {
118118 /// # Arguments
119119 ///
120120 /// * `params` - struct containing the header section of the boot parameters, additional
121- /// sections and modules, and their associated addresses in guest memory. These
122- /// vary with the boot protocol used.
121+ /// sections and modules, and their associated addresses in guest memory. These
122+ /// vary with the boot protocol used.
123123 /// * `guest_memory` - guest's physical memory.
124124 fn write_bootparams < M > ( params : & BootParams , guest_memory : & M ) -> Result < ( ) >
125125 where
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ impl BootConfigurator for LinuxBootConfigurator {
5656 /// # Arguments
5757 ///
5858 /// * `params` - boot parameters. The header contains a [`boot_params`] struct. The `sections`
59- /// and `modules` are unused.
59+ /// and `modules` are unused.
6060 /// * `guest_memory` - guest's physical memory.
6161 ///
6262 /// # Examples
Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ impl BootConfigurator for PvhBootConfigurator {
9393 /// # Arguments
9494 ///
9595 /// * `params` - boot parameters. The header contains a [`hvm_start_info`] struct. The
96- /// sections contain the memory map in a vector of [`hvm_memmap_table_entry`]
97- /// structs. The modules, if specified, contain [`hvm_modlist_entry`] structs.
96+ /// sections contain the memory map in a vector of [`hvm_memmap_table_entry`]
97+ /// structs. The modules, if specified, contain [`hvm_modlist_entry`] structs.
9898 /// * `guest_memory` - guest's physical memory.
9999 ///
100100 /// [`hvm_start_info`]: ../loader/elf/start_info/struct.hvm_start_info.html
You can’t perform that action at this time.
0 commit comments