]> git.lizzy.rs Git - rust.git/blob - src/docs/bool_assert_comparison.txt
Auto merge of #9425 - kraktus:patch-1, r=xFrednet
[rust.git] / src / docs / bool_assert_comparison.txt
1 ### What it does
2 This lint warns about boolean comparisons in assert-like macros.
3
4 ### Why is this bad?
5 It is shorter to use the equivalent.
6
7 ### Example
8 ```
9 assert_eq!("a".is_empty(), false);
10 assert_ne!("a".is_empty(), true);
11 ```
12
13 Use instead:
14 ```
15 assert!(!"a".is_empty());
16 ```