File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -608,7 +608,7 @@ impl MemTypeLayout {
608608 let usage_fixed_len = usage
609609 . max_size
610610 . map ( |size| {
611- if size % usage_stride. get ( ) != 0 {
611+ if ! size. is_multiple_of ( usage_stride. get ( ) ) {
612612 // FIXME(eddyb) maybe this should be propagated up,
613613 // as a sign that `usage` is malformed?
614614 return Err ( ( ) ) ;
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ impl<'a> LiftToSpvPtrs<'a> {
245245 let fixed_len = usage
246246 . max_size
247247 . map ( |size| {
248- if size % stride. get ( ) != 0 {
248+ if ! size. is_multiple_of ( stride. get ( ) ) {
249249 return Err ( LiftError ( Diag :: bug ( [ format ! (
250250 "DynOffsetBase: size ({size}) not a multiple of stride ({stride})"
251251 )
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ impl ModuleParser {
266266 pub fn read_from_spv_bytes ( spv_bytes : Vec < u8 > ) -> io:: Result < Self > {
267267 let spv_spec = spec:: Spec :: get ( ) ;
268268
269- if spv_bytes. len ( ) % 4 != 0 {
269+ if ! spv_bytes. len ( ) . is_multiple_of ( 4 ) {
270270 return Err ( invalid ( "not a multiple of 4 bytes" ) ) ;
271271 }
272272 // May need to mutate the bytes (to normalize endianness) later below.
You can’t perform that action at this time.
0 commit comments