Hacker News new | ask | show | jobs
by tialaramex 1173 days ago
Clippy can help you to write more idiomatic Rust, so if you aren't already, definitely check out the clippy lints for a working program you wrote:

  cargo clippy
Clippy won't tend to spot unnecessary Arcs and similar architectural mistakes, however it would notice if you act as though things aren't Copy when they are [e.g. you've probably never 100.clone() but if you did Clippy would point out that's just 100 and the same would apply to types where it's less obvious that they're Copy and you might have forgotten]
1 comments

Yeah clippy is amazing, but I was thinking things everyone has to do sometimes in rust, but that if you find yourself having to resort to them often might be a hint that your overall paradigm might need a tweak to fit well. I didn't mean unnecessary arcs, but rather necessary ones. I find that if I donthings the way Ferris wants me to, that I dont have arc, rc, refcell, or clone very often, and nothing ends up needing to derive copy. When Ferris is happy my life is easier.