]> git.lizzy.rs Git - rust.git/blob - src/docs/assertions_on_result_states.txt
[Arithmetic] Consider literals
[rust.git] / src / docs / assertions_on_result_states.txt
1 ### What it does
2 Checks for `assert!(r.is_ok())` or `assert!(r.is_err())` calls.
3
4 ### Why is this bad?
5 An assertion failure cannot output an useful message of the error.
6
7 ### Known problems
8 The suggested replacement decreases the readability of code and log output.
9
10 ### Example
11 ```
12 assert!(r.is_ok());
13 assert!(r.is_err());
14 ```