Run clippy on the codebase to start setting us up for inclusion in the CI
There are a few things missing that will require a separate MR before we can add clippy to the CI, but this goes most of the way. Aside from better looking code, tt found a few optimizations, and even found a bug, (which I'll graft to stable)!
Edited by Raphaël Gomès