On integer types in Rust
Marcin Baraniecki
1302

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.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.