Unused lints

Let's face it, we sometimes forget to remove a dependency we are no longer using, or we forget that the write() method returns the number of bytes written. This usually is not a big deal. The first will simply make our compilation slower, while the second, in most cases, will simply not change our code.

But since we do not want to have unused dependencies, or we don't want to forget that we might not have written the whole buffer to a file, that's where the next lints come to help us. Let's start with the first one, the unused_extern_crates lint. This lint will mark the external crates that are not being used in our code. This can be useful to remove dependencies we are no longer using, so I usually configure it to warn while ...

Get Rust High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.