fix(simulation): Clippy cleanup and CI enforcement (#635)
Fix all Clippy warnings across the server codebase (2411 insertions, 1341 deletions). Raise type-complexity-threshold to 750 and too-many-arguments to 12 in .clippy.toml for idiomatic Bevy ECS system signatures. The server now passes `cargo clippy -- --deny warnings` cleanly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
use bevy_ecs::prelude::*;
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
|
||||
use crate::bridge::types::*;
|
||||
use crate::knowledge::graph::filter_by_access;
|
||||
use crate::knowledge::types::{AccessRule, KnowledgeState};
|
||||
@@ -28,11 +27,11 @@ use crate::simulation::monologue::{MonologueBuffer, SprintAnomalyQueue};
|
||||
use crate::simulation::movement::{PlayerCharacter, TilePosition, WalkabilityMap};
|
||||
use crate::simulation::poi::PointOfInterest;
|
||||
use crate::simulation::rng::SimRng;
|
||||
use crate::simulation::triangle::TriangleCrisisEventQueue;
|
||||
use crate::simulation::sound::SoundEventQueue;
|
||||
use crate::simulation::stance::Stance;
|
||||
use crate::simulation::ticker::{TickerPool, LAST_SHIFT_ZONE_ID};
|
||||
use crate::simulation::time::SimulationTime;
|
||||
use crate::simulation::triangle::TriangleCrisisEventQueue;
|
||||
use crate::simulation::zone::ZoneMap;
|
||||
|
||||
/// Compute visibility geometry using the active perception mode.
|
||||
@@ -154,12 +153,15 @@ pub fn compute_observer_snapshot(
|
||||
.unwrap_or_default();
|
||||
|
||||
// Resolve observer's StableId for component-level access control (#139, D-010)
|
||||
let observer_stable_id = registry
|
||||
.to_stable(observer_entity)
|
||||
.unwrap_or(StableId(0));
|
||||
let observer_stable_id = registry.to_stable(observer_entity).unwrap_or(StableId(0));
|
||||
|
||||
let (mut entities, visible_ids, blocked_entities) =
|
||||
filter_visible_entities(&geometry, ®istry, observer_kg, observer_stable_id, &all_entities);
|
||||
let (mut entities, visible_ids, blocked_entities) = filter_visible_entities(
|
||||
&geometry,
|
||||
®istry,
|
||||
observer_kg,
|
||||
observer_stable_id,
|
||||
&all_entities,
|
||||
);
|
||||
|
||||
collect_remembered_entities(
|
||||
observer_kg,
|
||||
@@ -210,13 +212,14 @@ pub fn compute_observer_snapshot(
|
||||
|
||||
let current_monologue = monologue_buffer.take();
|
||||
let dialogue_response = dialogue_response_opt.as_mut().and_then(|buf| buf.take());
|
||||
let examine_result = examine_result_buffer_opt.as_mut().and_then(|buf| buf.take()).map(
|
||||
|evt| crate::bridge::types::ExamineResultWire {
|
||||
let examine_result = examine_result_buffer_opt
|
||||
.as_mut()
|
||||
.and_then(|buf| buf.take())
|
||||
.map(|evt| crate::bridge::types::ExamineResultWire {
|
||||
entity_id: evt.target_entity_id,
|
||||
text: evt.text,
|
||||
confidence: crate::knowledge::types::KnowledgeConfidence::KnowsDetails,
|
||||
},
|
||||
);
|
||||
});
|
||||
let scan_events = scan_event_buffer_opt
|
||||
.as_mut()
|
||||
.map(|buf| buf.take())
|
||||
@@ -438,9 +441,7 @@ pub fn compute_observer_snapshot(
|
||||
};
|
||||
|
||||
// Drain sim errors collected this tick (#85)
|
||||
let sim_errors = error_buffer
|
||||
.map(|mut buf| buf.drain())
|
||||
.unwrap_or_default();
|
||||
let sim_errors = error_buffer.map(|mut buf| buf.drain()).unwrap_or_default();
|
||||
|
||||
// News ticker (#591): populate when player is in The Last Shift zone.
|
||||
let player_zone = zone_map
|
||||
@@ -472,9 +473,10 @@ pub fn compute_observer_snapshot(
|
||||
conversation_events,
|
||||
conversation_ended,
|
||||
follow_state,
|
||||
character_pressure: pressure_query.iter().next().map(|p| {
|
||||
crate::simulation::pressure::CharacterPressureWire::from(p)
|
||||
}),
|
||||
character_pressure: pressure_query
|
||||
.iter()
|
||||
.next()
|
||||
.map(crate::simulation::pressure::CharacterPressureWire::from),
|
||||
sound_events,
|
||||
rng_seed: sim_rng.as_deref().map(|r| r.seed()),
|
||||
poi_list,
|
||||
|
||||
Reference in New Issue
Block a user