rust-lang/rust-clippy
Ver no GitHubManual assert_eq! (enhance `if_then_panic`)
Open
#7.716 aberto em 24 de set. de 2021
C-enhancementgood first issue
Métricas do repositório
- Stars
- (10.406 stars)
- Métricas de merge de PR
- (Mesclagem média 19d 22h) (113 fundiu PRs em 30d)
Description
We just added if_then_panic, but then I realized there's a possible enhancement for assert_eq!/assert_ne!:
// before
if a != b {
panic!("hi");
}
// after
assert_eq!(a, b, "hi");
I think a rename to manual_assert would be best. But we could also keep the current name (it still kinda makes sense) or create a new lint for this case.