Skip to content

Commit ef1de53

Browse files
committed
Fix new clippy::manual_is_multiple_of warnings.
1 parent 219ab8f commit ef1de53

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/qptr/analyze.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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(());

src/qptr/lift.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
)

src/spv/read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)