From 63348dbbea2a9483c07dfc74ab363f34cc8054bc Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 1 Jul 2025 02:45:53 +0700 Subject: [PATCH] clippy: use is_multiple_of --- azalea/src/pathfinder/astar.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azalea/src/pathfinder/astar.rs b/azalea/src/pathfinder/astar.rs index 8d23ed2e..71e0b9ef 100644 --- a/azalea/src/pathfinder/astar.rs +++ b/azalea/src/pathfinder/astar.rs @@ -65,7 +65,7 @@ where let mut best_paths: [usize; 7] = [0; 7]; let mut best_path_scores: [f32; 7] = [heuristic(start); 7]; - let mut num_nodes = 0; + let mut num_nodes = 0_usize; let mut num_movements = 0; while let Some(WeightedNode { index, g_score, .. }) = open_set.pop() { @@ -136,7 +136,7 @@ where } // check for timeout every ~10ms - if num_nodes % 10000 == 0 { + if num_nodes.is_multiple_of(10_000) { let min_timeout_reached = match min_timeout { PathfinderTimeout::Time(max_duration) => start_time.elapsed() >= max_duration, PathfinderTimeout::Nodes(max_nodes) => num_nodes >= max_nodes,