mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
fixed clippy warnings
This commit is contained in:
@@ -177,7 +177,7 @@ fn colorize(handle: Handle<UiNode>, ui: &UserInterface, index: &mut usize) {
|
||||
|
||||
if let Some(decorator) = node.cast::<Decorator>() {
|
||||
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)
|
||||
|
||||
@@ -1355,7 +1355,7 @@ where
|
||||
if val >= begin && val < end {
|
||||
let record_size = std::mem::size_of::<PoolRecord<T>>();
|
||||
let record_location = (val - offset_of!(PoolRecord<T>, 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);
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user