style(server): clear clippy-1.93 cfg(test)/test-target debt (#967)
Manual clippy-1.93 fixes that the prior machine-applicable sweep couldn't auto- apply, all in cfg(test) modules and tests/ targets (invisible to the lib-only pre-push clippy, hence accumulated unflagged): - disallowed_types HashSet/HashMap → BTreeSet/BTreeMap (determinism rule): shadowcast_bench.rs (×8, (i32,i32) keys), mood.rs, sound.rs. SoundEventKind gains a PartialOrd/Ord derive (fieldless Copy enum) so it is BTree-usable. - field_reassign_with_default → struct-init: disclosure.rs, monologue.rs (×2), save_io.rs (keeps `mut` for the deliberate last-write-wins overwrite). - assertions_on_constants on the EAVESDROP_THRESHOLD invariant → compile-time `const _: () = assert!(...)`: listening.rs, cross_room_transitions.rs. This is stronger than the runtime assert and needs no #[allow]. - approx_constant: settings/types.rs round-trip literal 3.14 → 2.5 (the value is arbitrary test data, never meant to be PI — change avoids both the lint and a suppression). - drop_non_drop: vision.rs early Mut<WalkabilityMap> release → scoped block. - unnecessary_get_then_check → contains_key: information_boundaries.rs (×3). - cloned_ref_to_slice_refs → std::slice::from_ref: triangle_validation.rs. - unused_must_use: input.rs dropped the unused .id() on a spawn. cargo clippy --all-targets -- -D warnings is clean; cargo test green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -819,12 +819,13 @@ mod tests {
|
||||
queue.push_anomaly(42, 0);
|
||||
|
||||
// Pre-fill the monologue buffer (as if trigger_monologue already wrote)
|
||||
let mut buffer = MonologueBuffer::default();
|
||||
buffer.event = Some(MonologueEvent {
|
||||
id: "existing_line".to_string(),
|
||||
text: "I should keep this.".to_string(),
|
||||
duration_seconds: 5.0,
|
||||
});
|
||||
let buffer = MonologueBuffer {
|
||||
event: Some(MonologueEvent {
|
||||
id: "existing_line".to_string(),
|
||||
text: "I should keep this.".to_string(),
|
||||
duration_seconds: 5.0,
|
||||
}),
|
||||
};
|
||||
|
||||
world.spawn((
|
||||
PlayerCharacter,
|
||||
@@ -1074,12 +1075,13 @@ mod tests {
|
||||
});
|
||||
|
||||
// Pre-fill MonologueBuffer (e.g., from trigger_monologue)
|
||||
let mut buffer = MonologueBuffer::default();
|
||||
buffer.event = Some(MonologueEvent {
|
||||
id: "existing_line".to_string(),
|
||||
text: "Already have something to say.".to_string(),
|
||||
duration_seconds: 5.0,
|
||||
});
|
||||
let buffer = MonologueBuffer {
|
||||
event: Some(MonologueEvent {
|
||||
id: "existing_line".to_string(),
|
||||
text: "Already have something to say.".to_string(),
|
||||
duration_seconds: 5.0,
|
||||
}),
|
||||
};
|
||||
|
||||
world.spawn((
|
||||
PlayerCharacter,
|
||||
|
||||
Reference in New Issue
Block a user