From 9068fcbc0b4d9fdb3e8abec4ff930c49ef544436 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sat, 25 Jul 2026 01:16:43 +0200 Subject: [PATCH] style(simulation): cargo fmt on the T-1174 batch (gate bounce) Co-Authored-By: Claude Fable 5 --- server/src/atlas/believability.rs | 5 +--- server/src/atlas/district_profile.rs | 11 +++---- server/src/atlas/gen_queue.rs | 5 +++- server/src/atlas/layer1.rs | 2 +- server/src/atlas/layer_proxy.rs | 45 +++++++++++++++------------- server/src/atlas/plugin.rs | 5 +++- 6 files changed, 41 insertions(+), 32 deletions(-) diff --git a/server/src/atlas/believability.rs b/server/src/atlas/believability.rs index 3327890dc..61dd577bb 100644 --- a/server/src/atlas/believability.rs +++ b/server/src/atlas/believability.rs @@ -336,10 +336,7 @@ pub fn analyze( ); let (mut relief_lo, mut relief_hi, mut relief_dry) = (i32::MAX, i32::MIN, 0i32); for &co in &RELIEF_TRANSECT_CHUNK_OFFSETS { - let cpos = ( - district_origin_chunk.0 + co, - district_origin_chunk.1 + co, - ); + let cpos = (district_origin_chunk.0 + co, district_origin_chunk.1 + co); let cctx = derive_chunk_context(world_seed, body_id, prof, cpos, None); let tx = cpos.0 * CHUNK_M + CHUNK_M / 2; let ty = cpos.1 * CHUNK_M + CHUNK_M / 2; diff --git a/server/src/atlas/district_profile.rs b/server/src/atlas/district_profile.rs index 9adb4dcce..86b807558 100644 --- a/server/src/atlas/district_profile.rs +++ b/server/src/atlas/district_profile.rs @@ -2240,10 +2240,7 @@ mod tests { None, ); - assert_eq!( - districts[&cell_east].basin_direction, - BasinDirection::East - ); + assert_eq!(districts[&cell_east].basin_direction, BasinDirection::East); assert_eq!( districts[&cell_south].basin_direction, BasinDirection::South @@ -3147,7 +3144,11 @@ mod tests { let districts = derive_all_districts(test_seed(), ¶ms, &ta, 8, "test_body", None, None); // BTreeMap iterates in sorted key order — verify the first key is (0,0). let first = districts.keys().next().expect("at least one district"); - assert_eq!(*first, SurveyCellPos(0, 0), "first district must be at origin"); + assert_eq!( + *first, + SurveyCellPos(0, 0), + "first district must be at origin" + ); } #[test] diff --git a/server/src/atlas/gen_queue.rs b/server/src/atlas/gen_queue.rs index 485dee5c2..8e5ba7bbb 100644 --- a/server/src/atlas/gen_queue.rs +++ b/server/src/atlas/gen_queue.rs @@ -756,7 +756,10 @@ pub(crate) fn resolve_settlement_morphology_zone( heightmap: &crate::atlas::heightmap::BodyHeightmap, ) -> Option { let params = body_params?; - let (_l1, ta) = terrain_cache.lock().unwrap().get_or_derive(body_id, heightmap); + let (_l1, ta) = terrain_cache + .lock() + .unwrap() + .get_or_derive(body_id, heightmap); let climate = ClimateConstants::default(); let profile = crate::atlas::district_profile::derive_at_metres( body_seed, diff --git a/server/src/atlas/layer1.rs b/server/src/atlas/layer1.rs index e7b898cef..6d60c2d05 100644 --- a/server/src/atlas/layer1.rs +++ b/server/src/atlas/layer1.rs @@ -27,7 +27,7 @@ use crate::atlas::body_world_state::{DrainageBasin, RiverNetwork}; use crate::atlas::drainage::{self, DrainageResult}; use crate::atlas::features::{self, TerrainAnalysis}; use crate::atlas::heightmap::BodyHeightmap; -use crate::atlas::scale::{BasinDirection, HEIGHTMAP_CELLS_PER_DISTRICT, SurveyCellPos}; +use crate::atlas::scale::{BasinDirection, SurveyCellPos, HEIGHTMAP_CELLS_PER_DISTRICT}; use crate::atlas::subbiome; use crate::simulation::generator::{AttractorType, GeographicAttractor}; use serde::{Deserialize, Serialize}; diff --git a/server/src/atlas/layer_proxy.rs b/server/src/atlas/layer_proxy.rs index e1ec34356..4a1e70f41 100644 --- a/server/src/atlas/layer_proxy.rs +++ b/server/src/atlas/layer_proxy.rs @@ -675,20 +675,8 @@ pub fn build_district_grid( if state.districts.is_empty() { return None; } - let cols = state - .districts - .keys() - .map(|p| p.0) - .max() - .unwrap_or(0) as u32 - + 1; - let rows = state - .districts - .keys() - .map(|p| p.1) - .max() - .unwrap_or(0) as u32 - + 1; + let cols = state.districts.keys().map(|p| p.0).max().unwrap_or(0) as u32 + 1; + let rows = state.districts.keys().map(|p| p.1).max().unwrap_or(0) as u32 + 1; let n = (cols * rows) as usize; let mut morphology = vec![0u8; n]; let mut elev_q = vec![0u8; n]; @@ -2840,8 +2828,13 @@ mod tests { // The SAME survey-cell-centre world metres, resolved via the SAME // D-256(b) bridge function derive_district_profile uses internally. - let (world_x_m, world_y_m) = - district_profile::survey_cell_centre_world_m(cell, gcpr, ta.w, ta.h, params.body_radius_km); + let (world_x_m, world_y_m) = district_profile::survey_cell_centre_world_m( + cell, + gcpr, + ta.w, + ta.h, + params.body_radius_km, + ); // Riparian equivalent: near_perennial_water_at against the same // RiverNetwork, same station spacing/cutoff derive_district_profile @@ -2891,9 +2884,18 @@ mod tests { // returns the default; the wrapper post-call-overrides it. expected.basin_direction = basin; - assert_eq!(batch_profile.morphology_zone as u8, expected.morphology_zone as u8); - assert_eq!(batch_profile.tectonic_class as u8, expected.tectonic_class as u8); - assert_eq!(batch_profile.glaciation_grade as u8, expected.glaciation_grade as u8); + assert_eq!( + batch_profile.morphology_zone as u8, + expected.morphology_zone as u8 + ); + assert_eq!( + batch_profile.tectonic_class as u8, + expected.tectonic_class as u8 + ); + assert_eq!( + batch_profile.glaciation_grade as u8, + expected.glaciation_grade as u8 + ); assert_eq!( batch_profile.precipitation_class as u8, expected.precipitation_class as u8 @@ -2908,7 +2910,10 @@ mod tests { batch_profile.vegetation_class as u8, expected.vegetation_class as u8 ); - assert_eq!(batch_profile.basin_direction as u8, expected.basin_direction as u8); + assert_eq!( + batch_profile.basin_direction as u8, + expected.basin_direction as u8 + ); } /// D-256(c) invariant: the wrapper (`derive_district_profile`) ≡ core diff --git a/server/src/atlas/plugin.rs b/server/src/atlas/plugin.rs index e8131b5a6..a4c2cd0e2 100644 --- a/server/src/atlas/plugin.rs +++ b/server/src/atlas/plugin.rs @@ -1507,7 +1507,10 @@ mod tests { SeedChain::for_body(0, "BodyX"), &heightmap, ); - assert_eq!(zone, None, "no body_params → no resolution, caller keeps the stub"); + assert_eq!( + zone, None, + "no body_params → no resolution, caller keeps the stub" + ); } /// D-256(d): with real `body_params`, `resolve_settlement_morphology_zone`