style(simulation): gate bounce — cargo fmt

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 16:53:41 +02:00
co-authored by Claude Fable 5
parent 497f9dc94d
commit 71f70f035e
6 changed files with 23 additions and 28 deletions
+3 -1
View File
@@ -686,7 +686,9 @@ fn read_feature_names(db: &PathBuf, body_id: &str) -> Result<(Vec<String>, Vec<S
let (name, feature_type) = match row { let (name, feature_type) = match row {
Ok(r) => r, Ok(r) => r,
Err(e) => { Err(e) => {
eprintln!("[believability] skipped a malformed feature name row for {body_id}: {e}"); eprintln!(
"[believability] skipped a malformed feature name row for {body_id}: {e}"
);
continue; continue;
} }
}; };
+8 -12
View File
@@ -301,15 +301,13 @@ pub fn run_cascade_from_heightmap(
name, name,
feature_type: layer1::FeatureNameType::River, feature_type: layer1::FeatureNameType::River,
}) })
.chain( .chain(mountain_assignments.into_iter().map(|(position, name)| {
mountain_assignments layer1::FeatureNameAssignment {
.into_iter() position,
.map(|(position, name)| layer1::FeatureNameAssignment { name,
position, feature_type: layer1::FeatureNameType::Mountain,
name, }
feature_type: layer1::FeatureNameType::Mountain, }))
}),
)
.collect(); .collect();
snapshot.layer1 = Some(l1); snapshot.layer1 = Some(l1);
snapshot.terrain_analysis = Some(ta); snapshot.terrain_analysis = Some(ta);
@@ -607,9 +605,7 @@ mod tests {
let river_attractor_count = l1 let river_attractor_count = l1
.attractors .attractors
.iter() .iter()
.filter(|a| { .filter(|a| a.attractor_type == crate::simulation::generator::AttractorType::RiverMouth)
a.attractor_type == crate::simulation::generator::AttractorType::RiverMouth
})
.count(); .count();
let expected_river_assignments = river_attractor_count.min(river_names.len()); let expected_river_assignments = river_attractor_count.min(river_names.len());
let actual_river_assignments = l1 let actual_river_assignments = l1
+7 -10
View File
@@ -2074,9 +2074,8 @@ pub fn derive_orbital_at_metres(
let (wdx, wdy) = coast_invention::coast_warp_px(seed.seed(), world_x_m, world_y_m, &ch, 0.0); let (wdx, wdy) = coast_invention::coast_warp_px(seed.seed(), world_x_m, world_y_m, &ch, 0.0);
let (spx, spy) = (px + wdx, py + wdy); let (spx, spy) = (px + wdx, py + wdy);
let elev_q = let elev_q = ((bilinear(&ta.elev_pct, ta.w, ta.h, spx, spy) as f64 * 100.0).round() as i32)
((bilinear(&ta.elev_pct, ta.w, ta.h, spx, spy) as f64 * 100.0).round() as i32) .clamp(0, 100);
.clamp(0, 100);
let ocean_fraction_q = ((bilinear_bool(&ta.ocean_mask, ta.w, ta.h, spx, spy) as f64 * 100.0) let ocean_fraction_q = ((bilinear_bool(&ta.ocean_mask, ta.w, ta.h, spx, spy) as f64 * 100.0)
.round() as i32) .round() as i32)
.clamp(0, 100); .clamp(0, 100);
@@ -3707,8 +3706,7 @@ mod tests {
latitude_deg: lat_deg, latitude_deg: lat_deg,
..body_params.clone() ..body_params.clone()
}; };
let driver_temp = let driver_temp = derive_temperature_c(&driver_params, &climate, seed.seed());
derive_temperature_c(&driver_params, &climate, seed.seed());
let driver_moisture = let driver_moisture =
derive_moisture_q(&driver_params, raw_elev_q, raw_ocean_q, &climate); derive_moisture_q(&driver_params, raw_elev_q, raw_ocean_q, &climate);
let driver_glaciation = let driver_glaciation =
@@ -3731,11 +3729,10 @@ mod tests {
warp_only_nanos += warp_call_start.elapsed().as_nanos() as u64; warp_only_nanos += warp_call_start.elapsed().as_nanos() as u64;
warp_plus_character_nanos += warp_call_start.elapsed().as_nanos() as u64; warp_plus_character_nanos += warp_call_start.elapsed().as_nanos() as u64;
let (spx, spy) = (px + wdx, py + wdy); let (spx, spy) = (px + wdx, py + wdy);
let warped_ocean_q = ((bilinear_bool(&ta.ocean_mask, ta.w, ta.h, spx, spy) let warped_ocean_q =
as f64 ((bilinear_bool(&ta.ocean_mask, ta.w, ta.h, spx, spy) as f64 * 100.0)
* 100.0) .round() as i32)
.round() as i32) .clamp(0, 100);
.clamp(0, 100);
if (raw_ocean_q > 50) != (warped_ocean_q > 50) { if (raw_ocean_q > 50) != (warped_ocean_q > 50) {
disagreements += 1; disagreements += 1;
+2 -1
View File
@@ -257,7 +257,8 @@ impl WindowGranularity {
/// exists). A future coarser-than-region rung is added by widening this /// exists). A future coarser-than-region rung is added by widening this
/// function's match AND [`WindowGranularity`]'s variant list together. /// function's match AND [`WindowGranularity`]'s variant list together.
fn resolve_window_granularity_v2(req: &AtlasLayerRequest) -> WindowGranularity { fn resolve_window_granularity_v2(req: &AtlasLayerRequest) -> WindowGranularity {
req.window_granularity_v2.unwrap_or(WindowGranularity::District) req.window_granularity_v2
.unwrap_or(WindowGranularity::District)
} }
/// Clamp `window_n` against BOTH the existing per-axis cap /// Clamp `window_n` against BOTH the existing per-axis cap
+2 -2
View File
@@ -7,8 +7,8 @@ use bevy_ecs::prelude::*;
use bevy_ecs::schedule::IntoScheduleConfigs; use bevy_ecs::schedule::IntoScheduleConfigs;
use crate::atlas::atlas_data_proxy::{ use crate::atlas::atlas_data_proxy::{
CityNamesRequest, CityNamesResponse, FeatureNamesRequest, FeatureNamesResponse, CityNamesRequest, CityNamesResponse, FeatureNamesRequest, FeatureNamesResponse, StarMapRequest,
StarMapRequest, StarMapResponse, StarMapResponse,
}; };
use crate::atlas::browse_proxy::{BrowseRequest, BrowseResponse}; use crate::atlas::browse_proxy::{BrowseRequest, BrowseResponse};
use crate::atlas::layer_proxy::{AtlasLayerRequest, AtlasLayerResponse}; use crate::atlas::layer_proxy::{AtlasLayerRequest, AtlasLayerResponse};
+1 -2
View File
@@ -392,8 +392,7 @@ fn single_tick_drains_all_ready_inbound_frames() {
feature_names: true, feature_names: true,
body_id: "GJ1c".into(), body_id: "GJ1c".into(),
}; };
let payload = let payload = rmp_serde::to_vec_named(&fn_req).expect("failed to serialize feature names");
rmp_serde::to_vec_named(&fn_req).expect("failed to serialize feature names");
write_framed(&mut stream, &payload).expect("write feature names frame"); write_framed(&mut stream, &payload).expect("write feature names frame");
stream stream
}); });