5–6 is an integer underflow, not overflow.
I think Rust only panics on integer over/underflow in debug builds.
You could probably express max_i better as (range/2)-1.
Finally I wouldn’t encourage people to choose smaller integers to save memory. Unless you are storing a large array of numbers (e.g. an image or audio), memory use will be totally insignificant and you are best off using i32 or i64.