Re:Speeding Up the Rust Compiler
by bluejekyll on Wednesday December 11, 2019 @03:19PM
(#21766363)
Some of those style things are better style specifically because they help avoid common bugs.
I’ve found that it is helpful in avoiding those and additional directing you to more performant choices. YMMV.
> For off by 1 errors, in Rust it’s often better to turn to iterators where appropriate than to say using indexes (it’s also more efficient in most cases).
The off-by-one errors I made weren't related to indexing collections. I don't remember anymore what it was exactly, it got caught by the very first tests I wrote before even trying to use anything. I do use iterators whenever they make sense and I write new iterators whenever it makes sense. Still, good note from you.