refactor(server): apply rustfmt and clippy suggestions
Formatting pass across simulation, perception, knowledge, NPC, and test modules. Includes two clippy fixes in monologue.rs (.values() instead of for (_, v) pattern). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,12 +38,7 @@ pub struct InventorySlot(pub u8);
|
||||
/// Find the next available inventory slot for a carrier.
|
||||
/// Returns None if all 9 slots are occupied.
|
||||
pub fn find_next_slot(occupied: &[u8]) -> Option<u8> {
|
||||
for slot in 0..MAX_INVENTORY_SLOTS {
|
||||
if !occupied.contains(&slot) {
|
||||
return Some(slot);
|
||||
}
|
||||
}
|
||||
None
|
||||
(0..MAX_INVENTORY_SLOTS).find(|slot| !occupied.contains(slot))
|
||||
}
|
||||
|
||||
/// Collect inventory items for a specific carrier (by StableId).
|
||||
@@ -126,8 +121,7 @@ mod tests {
|
||||
let player = world.spawn_empty().id();
|
||||
let player_sid = world.resource_mut::<EntityRegistry>().register(player);
|
||||
|
||||
let mut query_state =
|
||||
world.query::<(Entity, &CarriedBy, &ItemName, &InventorySlot)>();
|
||||
let mut query_state = world.query::<(Entity, &CarriedBy, &ItemName, &InventorySlot)>();
|
||||
|
||||
// Can't use system params directly in tests — use world query
|
||||
// Instead, verify the logic by spawning items and checking
|
||||
|
||||
Reference in New Issue
Block a user