Closed

Description
What it does
It checks for asserts like assert!(1 == 1);
and suggests to replace it with assert_eq!(1, 1);
.
As far as I know, this is more idiomatic.
Categories (optional)
- Kind: most likely
clippy::style
or maybeclippy::complexity
.
The advantage is idiomacy and consistency/consistent style.
It can also improve readability and the _eq
/_ne
variants make it much easier to search for specific kind of asserts (no regex for example needed).
Drawbacks
None.
Example
assert!(1 == 1);
assert!(5 != 10);
debug_assert!(1 == 1);
debug_assert!(5 != 10);
Could be written as:
assert_eq!(1, 1);
assert_ne!(5, 10);
debug_assert_eq!(1, 1);
debug_assert_ne!(5, 10);