refactor(simulation): apply rustfmt formatting

Formatting-only changes across server source and test files.
No logic changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-18 01:39:44 +01:00
co-authored by Claude Opus 4.6
parent 1da81a21ea
commit d5a1f6dadb
16 changed files with 169 additions and 105 deletions
+19 -17
View File
@@ -39,18 +39,12 @@ pub(crate) const ANOMALY_DELAY_TICKS: u64 = 90;
/// Fire DURING cognitive delay (when grey blob appears). Future: move to
/// content pools with trigger="observe_anomaly" + character match.
const RECOGNITION_LINES: &[(&str, &str)] = &[
(
"recognition_01",
"Wait \u{2014} I know that walk.",
),
("recognition_01", "Wait \u{2014} I know that walk."),
(
"recognition_02",
"Those footsteps... I've heard that pattern before.",
),
(
"recognition_03",
"Something about that silhouette...",
),
("recognition_03", "Something about that silhouette..."),
];
/// Hardcoded v0.1 sprint anomaly "double-take" lines.
@@ -258,9 +252,9 @@ pub fn trigger_recognition_monologue(
let pending = cognitive_delay.pending_mut();
let target_idx = {
// First pass: anomalous + unfired
let anomaly_idx = pending.iter().position(|p| {
!p.monologue_fired && anomaly_markers.get(p.target).is_ok()
});
let anomaly_idx = pending
.iter()
.position(|p| !p.monologue_fired && anomaly_markers.get(p.target).is_ok());
if let Some(idx) = anomaly_idx {
Some(idx)
} else {
@@ -872,10 +866,10 @@ mod tests {
// trigger_recognition_monologue tests (#451, D-060)
// -----------------------------------------------------------------------
use crate::knowledge::types::StableId;
use crate::perception::cognitive_delay::{
CognitiveDelay, PendingRecognition, RecognitionTrigger, NORMAL_DELAY_TICKS,
};
use crate::knowledge::types::StableId;
fn setup_recognition_world() -> World {
let mut world = World::new();
@@ -957,7 +951,12 @@ mod tests {
// First tick: fires
schedule.run(&mut world);
assert!(
world.query::<&MonologueBuffer>().single(&world).unwrap().event.is_some(),
world
.query::<&MonologueBuffer>()
.single(&world)
.unwrap()
.event
.is_some(),
"first tick should fire"
);
@@ -967,7 +966,12 @@ mod tests {
// Second tick: should NOT fire (monologue_fired = true)
schedule.run(&mut world);
assert!(
world.query::<&MonologueBuffer>().single(&world).unwrap().event.is_none(),
world
.query::<&MonologueBuffer>()
.single(&world)
.unwrap()
.event
.is_none(),
"second tick should not fire (already fired for this recognition)"
);
}
@@ -1053,9 +1057,7 @@ mod tests {
let mut world = setup_recognition_world();
let normal_target = world.spawn_empty().id();
let anomalous_target = world
.spawn(crate::perception::anomaly::AnomalyMarker)
.id();
let anomalous_target = world.spawn(crate::perception::anomaly::AnomalyMarker).id();
let mut cd = CognitiveDelay::default();
// Normal entity added first