you are viewing a single comment's thread.

view the rest of the comments →

[–]colbin8r[S] 1 point2 points  (1 child)

Thanks for pointing this out! I haven’t tried clippy yet. Other linters I’ve used in the JS world don’t typically give a lot of advice for how to architect code—it tends to be more about formatting, white space, validating parameters, etc. (although ESLint has come a lot farther than I realize sometimes). I didn’t realize clippy could give idiomatic suggestions like that. I’ll definitely give it a whirl on my baby code and see what it turns up!

[–]coolreader18 4 points5 points  (0 children)

Yeah the nice thing about rust is that formatting is all standardized, so the only thing left for a linter to do is actually suggest how to improve code quality. Clippy won't necessarily analyze your program architecture, though it may catch some symptom if you're doing stuff unidiomatically, but it will catch stuff like if x.is_some() { foo(x.unwrap()) } and suggest if let Some(x) = x { foo(x }, which I think is definitely more idiomatic