4 ms·
> Indexing into a vector unwraps That's what it's supposed to do, RTFM. Use .get() for safe access.
by shakow 4y ago
> Indexing into a vector unwraps
That's what it's supposed to do, RTFM.
Use .get() for safe access.
- School-Cotton 4y agoEr, yes I know, I use rust every day as a primary language. I was just giving an example, not claiming it wasn’t documented.
- shakow 4y agoThen what is the issue if you know both the “fast-but-panicking” and “slow-but-Option-ing” versions?
- School-Cotton 4y agoFirst of all, neither is faster than the other. Second, I never claimed it was an issue or a bad thing at any point. Someone asked for examples of libraries that panic, and I gave an example. I must be missing something because it makes no sense to me that people seem to be responding defensively and claiming that I either don’t understand the Rust docs or am pointing out problems in Rust.