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
camsteffen opened this issue
Sep 8, 2021
· 3 comments
· Fixed by #7669
Assignees
Labels
A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.L-styleLint: Belongs in the style lint group
Detects if-then-panic! that can be replaced with assert!
Categories (optional)
Kind: style
What is the advantage of the recommended code over the original code
It is simpler
Drawbacks
None.
Example
if !sad_people.is_empty(){panic!("there are sad people: {:?}", sad_people);}
Could be written as:
assert!(sad_people.is_empty(),"there are sad people: {:?}", sad_people);
Lint name: manual_assert or if_then_panic
The text was updated successfully, but these errors were encountered:
camsteffen
added
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
A-lint
Area: New lints
L-style
Lint: Belongs in the style lint group
labels
Sep 8, 2021
A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.L-styleLint: Belongs in the style lint group
What it does
Detects
if
-then-panic!
that can be replaced withassert!
Categories (optional)
What is the advantage of the recommended code over the original code
It is simpler
Drawbacks
None.
Example
Could be written as:
Lint name:
manual_assert
orif_then_panic
The text was updated successfully, but these errors were encountered: