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 {
Ok(r) => r,
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;
}
};
+8 -12
View File
@@ -301,15 +301,13 @@ pub fn run_cascade_from_heightmap(
name,
feature_type: layer1::FeatureNameType::River,
})
.chain(
mountain_assignments
.into_iter()
.map(|(position, name)| layer1::FeatureNameAssignment {
position,
name,
feature_type: layer1::FeatureNameType::Mountain,
}),
)
.chain(mountain_assignments.into_iter().map(|(position, name)| {
layer1::FeatureNameAssignment {
position,
name,
feature_type: layer1::FeatureNameType::Mountain,
}
}))
.collect();
snapshot.layer1 = Some(l1);
snapshot.terrain_analysis = Some(ta);
@@ -607,9 +605,7 @@ mod tests {
let river_attractor_count = l1
.attractors
.iter()
.filter(|a| {
a.attractor_type == crate::simulation::generator::AttractorType::RiverMouth
})
.filter(|a| a.attractor_type == crate::simulation::generator::AttractorType::RiverMouth)
.count();
let expected_river_assignments = river_attractor_count.min(river_names.len());
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 (spx, spy) = (px + wdx, py + wdy);
let elev_q =
((bilinear(&ta.elev_pct, ta.w, ta.h, spx, spy) as f64 * 100.0).round() as i32)
.clamp(0, 100);
let elev_q = ((bilinear(&ta.elev_pct, ta.w, ta.h, spx, spy) as f64 * 100.0).round() as i32)
.clamp(0, 100);
let ocean_fraction_q = ((bilinear_bool(&ta.ocean_mask, ta.w, ta.h, spx, spy) as f64 * 100.0)
.round() as i32)
.clamp(0, 100);
@@ -3707,8 +3706,7 @@ mod tests {
latitude_deg: lat_deg,
..body_params.clone()
};
let driver_temp =
derive_temperature_c(&driver_params, &climate, seed.seed());
let driver_temp = derive_temperature_c(&driver_params, &climate, seed.seed());
let driver_moisture =
derive_moisture_q(&driver_params, raw_elev_q, raw_ocean_q, &climate);
let driver_glaciation =
@@ -3731,11 +3729,10 @@ mod tests {
warp_only_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 warped_ocean_q = ((bilinear_bool(&ta.ocean_mask, ta.w, ta.h, spx, spy)
as f64
* 100.0)
.round() as i32)
.clamp(0, 100);
let warped_ocean_q =
((bilinear_bool(&ta.ocean_mask, ta.w, ta.h, spx, spy) as f64 * 100.0)
.round() as i32)
.clamp(0, 100);
if (raw_ocean_q > 50) != (warped_ocean_q > 50) {
disagreements += 1;
+2 -1
View File
@@ -257,7 +257,8 @@ impl WindowGranularity {
/// exists). A future coarser-than-region rung is added by widening this
/// function's match AND [`WindowGranularity`]'s variant list together.
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
+2 -2
View File
@@ -7,8 +7,8 @@ use bevy_ecs::prelude::*;
use bevy_ecs::schedule::IntoScheduleConfigs;
use crate::atlas::atlas_data_proxy::{
CityNamesRequest, CityNamesResponse, FeatureNamesRequest, FeatureNamesResponse,
StarMapRequest, StarMapResponse,
CityNamesRequest, CityNamesResponse, FeatureNamesRequest, FeatureNamesResponse, StarMapRequest,
StarMapResponse,
};
use crate::atlas::browse_proxy::{BrowseRequest, BrowseResponse};
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,
body_id: "GJ1c".into(),
};
let payload =
rmp_serde::to_vec_named(&fn_req).expect("failed to serialize feature names");
let payload = rmp_serde::to_vec_named(&fn_req).expect("failed to serialize feature names");
write_framed(&mut stream, &payload).expect("write feature names frame");
stream
});