3 ms·
Teeeny tiny note > because Rust's get function v.get(i) is marked unsafe You mean get_unchecked. get is safe, and returns an Option, so that None can be retur
by steveklabnik 4y ago
Teeeny tiny note
> because Rust's get function v.get(i) is marked unsafe
You mean get_unchecked. get is safe, and returns an Option, so that None can be returned if something is out of bounds.
- tialaramex 4y agoDoh! I even had the "get_unchecked()" function in front of me on the screen and wrote get() anyway. Thanks Steve.
- steveklabnik 4y agoNo problem. Thanks for explaining what unsafe does and doesn't do; you're 100% right that this is a common misconception that comes up often.