Closed
Description
Context: I have a piece of code to check if a matrix is a unit matrix:
if i != j && self[[i, j]] != 0 || i == j && self[[i, j]] != 1 {
and Clippy thinks it's not minimal and suggest the same code:
warning: this boolean expression can be simplified
--> src/lib.rs:73:20
|
73 | if i != j && self[[i, j]] != 0 || i == j && self[[i, j]] != 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i != j && self[[i, j]] != 0 || i == j && self[[i, j]] != 1`
|
= note: #[warn(clippy::nonminimal_bool)] on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
Version info:
$ cargo clippy -V
clippy 0.0.212 (e3cb40e 2019-06-25)