Skip to content

Glossary: Coding Interviews in Rust

usize / i32 / i64 / u32 / isize

Also written: usize, i64, i32, u32, isize, overflow, underflow

Rust's whole-number types. `usize` is for indexes and can't go below 0, so a subtraction like `len() - 1` on an empty slice fails with "attempt to subtract with overflow". `i64` is used when sums can pass `i32`'s limit.

Where the book teaches it

Related terms

Panicsaturating_add / saturating_sub