From 6402d44ce77e438927521279e574c367fe83dfbd Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Mon, 12 Oct 2026 17:57:27 +0200 Subject: [PATCH] Pass clippy and rustfmt after merging the parity branches Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/examples/server_files_probe.rs | 8 +++++--- crates/horizon-client/src/game/copper_golems.rs | 2 +- crates/horizon-client/src/mobs/animal_brain.rs | 8 ++------ crates/horizon-client/src/server/java_properties.rs | 4 +--- crates/horizon-world/src/datafix/fixes_cliffs.rs | 2 +- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/crates/horizon-client/examples/server_files_probe.rs b/crates/horizon-client/examples/server_files_probe.rs index 40bf13872..ce146be78 100644 --- a/crates/horizon-client/examples/server_files_probe.rs +++ b/crates/horizon-client/examples/server_files_probe.rs @@ -155,9 +155,11 @@ fn run_case(dir: &Path, out: &mut String) -> Result<(), Box { // BehaviorUtils.throwItem: from 0.3 below the golem's eyes towards // the player's feet at 0.3 blocks a tick, default pickup delay. let p = self.player.as_ref().map(|p| p.position); - let eye = f64::from(self.mobs[index].eye_height()); + let eye = self.mobs[index].eye_height(); let from = [at[0], at[1] + eye - f64::from(0.3f32), at[2]]; let v = p.map_or([0.0; 3], |p| { let d = [p.x - at[0], p.y - at[1], p.z - at[2]]; diff --git a/crates/horizon-client/src/mobs/animal_brain.rs b/crates/horizon-client/src/mobs/animal_brain.rs index c37fa469e..9edf2accf 100644 --- a/crates/horizon-client/src/mobs/animal_brain.rs +++ b/crates/horizon-client/src/mobs/animal_brain.rs @@ -1186,7 +1186,7 @@ impl B { }; // closerThan(adult, 17) && !closerThan(adult, 3) let d = m.distance_sqr(at.position); - if !(d < 17.0 * 17.0 && d >= 3.0 * 3.0) { + if !(3.0 * 3.0..17.0 * 17.0).contains(&d) { return false; } let mm = mem(m); @@ -1352,11 +1352,7 @@ impl B { let near = cx.w.target_info(player) .is_some_and(|t| m.distance_sqr(t.position) < close * close); - let speed = if brain_mut(m).kind == Kind::Sniffer { - 1.25 - } else { - 1.25 - }; + let speed = 1.25; let mm = mem(m); if near { mm.walk_target.clear(); diff --git a/crates/horizon-client/src/server/java_properties.rs b/crates/horizon-client/src/server/java_properties.rs index 05186833d..a326a7cc7 100644 --- a/crates/horizon-client/src/server/java_properties.rs +++ b/crates/horizon-client/src/server/java_properties.rs @@ -159,9 +159,7 @@ impl LineReader<'_> { } if line.is_empty() && (c == '#' || c == '!') { loop { - let Some(&d) = chars.get(self.pos) else { - return None; - }; + let &d = chars.get(self.pos)?; self.pos += 1; if d == '\r' || d == '\n' { break; diff --git a/crates/horizon-world/src/datafix/fixes_cliffs.rs b/crates/horizon-world/src/datafix/fixes_cliffs.rs index 0826433c8..a76d64f34 100644 --- a/crates/horizon-world/src/datafix/fixes_cliffs.rs +++ b/crates/horizon-world/src/datafix/fixes_cliffs.rs @@ -353,7 +353,7 @@ fn world_gen_height_and_biome(cx: &mut Cx) { cx.each(Ty::WorldGenSettings, |v| { let flag = v.get("has_increased_height_already").cloned(); let was_exp_snap = flag.is_none(); - let was_previously_increased = flag.as_ref().map_or(true, |f| as_bool(Some(f), true)); + let was_previously_increased = flag.as_ref().is_none_or(|f| as_bool(Some(f), true)); remove(v, "has_increased_height_already"); let Some(generator) = v .get_mut("dimensions")