Open 0xLucqs opened 5 days ago
Detects if-then-panic! that can be replaced with assert!.
assert! is simpler than if-then-panic!.
assert!
let sad_people: Array<&str> = arrray![]; if !sad_people.is_empty() { panic!("there are sad people: {:?}", sad_people); }
Use instead:
let sad_people: Array<&str> = array![]; assert!(sad_people.is_empty(), "there are sad people: {:?}", sad_people);
https://rust-lang.github.io/rust-clippy/master/index.html#/manual_assert
Hi, I would like to work on this!
Hey @stevencartavia! Thanks for showing interest. We've created an application for you to contribute to Cairo lint. Go check it out on OnlyDust!
let's go!
What it does
Detects if-then-panic! that can be replaced with assert!.
Why is this bad?
assert!
is simpler than if-then-panic!.Example
Use instead:
https://rust-lang.github.io/rust-clippy/master/index.html#/manual_assert