Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m pretty sure clippy “encourages” you to use .get() for Vectors returning an Option<> for you to deal with so accessing a bad index is avoidable in idiomatic rust.

I’m not sure that was the best example but I agree with your overall point.



It does not. I know because I advocated against it. :-) https://github.com/rust-lang/rust-clippy/issues/1300

Also, Clippy's defaults are developed to be quite opinionated. It makes many suggestions that I (and many others) disagree with. So Clippy's defaults should not be used as a bludgeon for what's idiomatic and correct.


(I also do not use clippy very aggressively due to disagreeing with a lot of lints)





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: