drop_overlay_rect panics via HashMap index operator on unknown PileType #26
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
File
solitaire_engine/src/cursor_plugin.rsline 388Description
layout.pile_positions[pile]uses theIndextrait onHashMap<PileType, Vec2>, which panics if the key is absent. This violates CLAUDE.md §2.3 (nounwrap()/panic!()in runtime game logic). Whilecompute_layoutis expected to populate all pile positions, this is an implicit runtime invariant — any future pile variant added without updatingcompute_layoutwould produce an unrecoverable panic during a drag operation.Fix
Replace with
layout.pile_positions.get(pile).copied().unwrap_or_default()or log a warning and return a fallback rect.