expect() in Startup system and TokioRuntimeResource::default() violate no-panic rule #33
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?
Files
solitaire_engine/src/font_plugin.rsline 35solitaire_engine/src/resources.rsline 141Description
Two
expect()calls in non-test runtime code violate CLAUDE.md §2.3:Font::try_from_bytes(...).expect("bundled FiraMono failed to parse")— a corrupted binary or storage error at startup panics the process instead of degrading gracefully.TokioRuntimeResource::default()calls.expect("failed to build shared Tokio runtime")— on Android, the OS can refuse thread creation under memory pressure, panicking the main thread during plugin setup.Fix
Replace both with
match/?propagation that logs the error and either falls back to a default handle or disables the dependent feature, consistent with the pattern used elsewhere in the engine.