| ▲ | namjh 26 minutes ago | |
That's just a design decision orthogonal to memory safety: For "fallible" variant indexing, you have `the_slice.get(index)`: https://doc.rust-lang.org/stable/std/primitive.slice.html#me... Although its method signature is kind of cursed due to generics, it matches your requirement that allows graceful OOB handling. If the default indexing behavior were like `.get()` it would be too cumbersome to express repeated use of indexing, or multi-dimensional array indexing, etc. Also there is get_unchecked which is unsafe. Trivially you'll trigger OOB access when misused. | ||