In a performance sensitive situation, I am doing slice element accesses. I get a significant speedup using get_unchecked rather than [i].
The accesses don't follow a clear pattern, so I haven't figured out a way of using iterators.
While I "know" that I have no bugs in my code, I would still love to be able to have the bounds checking in debug builds, but not have them in release builds. Is there a way of doing this - ideally one which preserves the [i] notation, but wraps it in some big scary "you better know what you are doing because you are optionally breaking security here" syntax, like "unsafe" + "get_unchecked" already does non-optionally?