Hacker News new | past | comments | ask | show | jobs | submit login

There are two clippy lints that cover these possible panics:

- indexing_slicing

- integer_arithmetic

Enabling those will throw an error on usage in your codebase.

Also it's worth noting that arithmetic is only checked against overflow when building in debug mode by default.




> Also it's worth noting that arithmetic is only checked against overflow when building in debug mode by default.

Yes, the default behavior in release mode is even worse!




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

Search: