Re:I stopped everything and started writing C again
by maleldil on Wednesday March 12, 2025 @09:43PM
(#43349595)
You can also add #![warn(clippy::all, clippy::pedantic)] to your main.rs/lib.rs file to get those lints project-wide.
Re:I stopped everything and started writing C again
by jpc0 on Thursday March 13, 2025 @01:09AM
(#43350549)
The truly pedantic setting here would by complaining about the magic number.
Why 1_000_000_000_000, what does that number mean.
It is for free to:
let my_special_thing = 1_000_000_000_000
since the compiler will just inline it.The readability problem was never the lack of separators, since that number might be the wrong number regardless.
Regarding Clippy, you can also crank it up with `cargo clippy -- -Wclippy::pedantic`. Some of the advice at that level gets a little suspect. Don't just blindly follow it. It offers some nice suggestions though, like:
that you don't get by default.