darthdeus / comfy

Comfy is a fun 2D game engine built in Rust. It's designed to be opinionated, productive, and easy to use.
https://comfyengine.org
Apache License 2.0
678 stars 28 forks source link

Vec::choose() sometimes returns an index out of range #99

Closed darthdeus closed 3 months ago

darthdeus commented 3 months ago

To repro something like this should be enough

let things = vec![1, 2, 3];

for _ in 0..1000000000000000 {
  things.choose().unwrap();
}

Seems to happen very rarely