Commit be0ef72
committed
planner: write the vector-primary key guard as is_none_or
`cargo clippy --profile ci -p nodedb --all-targets --all-features -- -D warnings`
aborts on this expression at `vector_primary.rs:161`:
error: this boolean expression can be simplified
= help: ... #nonminimal_bool
so the lint job is red on `main` for every branch, and the first thing it
reports is a file no branch has touched. Clippy's own suggested rewrite is this
one, and it is the negation identity `is_none_or(f) == !is_some_and(!f)`:
`!get(k).is_some_and(|v| !matches!(v, SqlValue::Null))` becomes
`get(k).is_none_or(|v| matches!(v, SqlValue::Null))`.
All three cases agree, including the one a reader might expect to differ — an
absent key inserts the key-column value under both spellings:
present non-null -> false / false
present Null -> true / true
absent -> true / true
Verified: `main` exits 101 on this file, this branch exits 0.1 parent f18b31e commit be0ef72
1 file changed
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
0 commit comments