diff --git a/editor/src/world/mod.rs b/editor/src/world/mod.rs index 2ee74dadb..aea5e3ee7 100644 --- a/editor/src/world/mod.rs +++ b/editor/src/world/mod.rs @@ -177,7 +177,7 @@ fn colorize(handle: Handle, ui: &UserInterface, index: &mut usize) { if let Some(decorator) = node.cast::() { if node.parent().is_some() { - let new_brush = if *index % 2 == 0 { + let new_brush = if (*index).is_multiple_of(2) { ui.style.property(Style::BRUSH_PRIMARY) } else { ui.style.property(Style::BRUSH_LIGHTER_PRIMARY) diff --git a/fyrox-core/src/pool/mod.rs b/fyrox-core/src/pool/mod.rs index f5554b515..6d13afbdd 100644 --- a/fyrox-core/src/pool/mod.rs +++ b/fyrox-core/src/pool/mod.rs @@ -1355,7 +1355,7 @@ where if val >= begin && val < end { let record_size = std::mem::size_of::>(); let record_location = (val - offset_of!(PoolRecord, payload)) - begin; - if record_location % record_size == 0 { + if record_location.is_multiple_of(record_size) { let index = record_location / record_size; let index = u32::try_from(index).expect("Index overflowed u32"); return self.handle_from_index(index); diff --git a/fyrox-ui/src/log.rs b/fyrox-ui/src/log.rs index bf9055c3f..5e3410d27 100644 --- a/fyrox-ui/src/log.rs +++ b/fyrox-ui/src/log.rs @@ -305,7 +305,7 @@ impl LogPanel { let ctx = &mut ui.build_ctx(); let item = BorderBuilder::new( WidgetBuilder::new() - .with_background(if count % 2 == 0 { + .with_background(if count.is_multiple_of(2) { ctx.style.property(Style::BRUSH_LIGHT) } else { ctx.style.property(Style::BRUSH_DARK)