News for hackers. Stuff that matters.
Re:Speeding Up the Rust Compiler by bluejekyll on Wednesday December 11, 2019 @09:25AM (#21762584)
A lot of those basic issues, clippy often catches. One thing I enabled recently to make sure it’s caught before release, is checking for spurious uses of dbg! and unimplememted!, as well as println! in production code.

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). Clippy can also catch those issues.

Re:Speeding Up the Rust Compiler by abjKT26nO8 on Wednesday December 11, 2019 @02:37PM (#21765932)
In my experience, all Clippy does is find style issues. Perhaps it's more effective in other projects, but in the code I wrote all by myself it didn't find a single error (as in bug). That's not to say Clippy isn't useful. I value style consistency (in this case consistency among the general pool of all Rust programmers and not inside a single project). Of course, 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.

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.