-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
A-lintArea: New lintsArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.L-styleLint: Belongs in the style lint groupLint: Belongs in the style lint group
Description
What it does
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
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.L-styleLint: Belongs in the style lint groupLint: Belongs in the style lint group