You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a library tries to be as "clean" as possible, it may want to prevent any accidental panics. Panics could be caused by many different calls. Clippy offers unwrap_used, todo, and some other lints, but there is no single lint that will catch any panic-producing calls. Granted that it is impossible to catch all such cases, but having a common lint that will grow as more panic-y functions are added to stdlib may offer a more stable solution.
Advantage
consolidates all panic-catching lints under one name, preventing user from accidentally missing some
as more panic-producing functions are added to stdlib, this lint will include them too
clearly indicates intention of "no panic" goal of the lib
Drawbacks
some panics are hard to catch, e.g. arithmetic wrapping (or maybe it should be caught too somehow?)
Example
result.unwrap()
Could be written as:
ifOk(v) = result { ...}else{ ...}
The text was updated successfully, but these errors were encountered:
@y21 thanks for the link! This is exactly what i was looking for (I wonder if this issue should be closed then?). My only concern is that the discussion has from the start dismissed the overlapping groups, making it far harder for the users (i.e. everyone now has to copy and maintain their own list of lints in each project - a huge detriment to usability). Overlapping lint groups is a far smaller evil in my opinion, especially now that we have group priorities.
What it does
When a library tries to be as "clean" as possible, it may want to prevent any accidental panics. Panics could be caused by many different calls. Clippy offers
unwrap_used
,todo
, and some other lints, but there is no single lint that will catch any panic-producing calls. Granted that it is impossible to catch all such cases, but having a common lint that will grow as more panic-y functions are added to stdlib may offer a more stable solution.Advantage
Drawbacks
some panics are hard to catch, e.g. arithmetic wrapping (or maybe it should be caught too somehow?)
Example
Could be written as:
The text was updated successfully, but these errors were encountered: