rust/tests
bors 398be8c842 Auto merge of #13443 - SpriteOvO:simplify-option-neg-methods, r=xFrednet
Simplify negative `Option::{is_some_and,is_none_or}`

Closes #13436.

Improved based on the existing lint `nonminimal_bool`, since there is already handling of similar methods `Option::{is_some,is_none}` and `Result::{is_ok,is_err}`, and there is a lot of reusable code.

When `is_some_and` or `is_none_or` have a negation, we invert it into another method by removing the Not sign and inverting the expression in the closure.

For the case where the closure block has statements, currently no simplification is implemented. (Should we do it?)

```rust
// Currently will not simplify this
_ = !opt.is_some_and(|x| {
    let complex_block = 100;
    x == complex_block
});
```

changelog: [`nonminimal_bool`]: Simplify negative `Option::{is_some_and,is_none_or}`
2024-10-02 08:54:12 +00:00
..
test_utils
ui Auto merge of #13443 - SpriteOvO:simplify-option-neg-methods, r=xFrednet 2024-10-02 08:54:12 +00:00
ui-cargo
ui-internal Formatting 2024-09-22 20:52:15 +02:00
ui-toml Fix non-lifetime tests 2024-09-25 13:52:12 -04:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs Formatting 2024-09-22 20:52:15 +02:00
config-metadata.rs Formatting 2024-09-22 20:52:15 +02:00
dogfood.rs
headers.rs
integration.rs
lint_message_convention.rs
missing-test-files.rs
versioncheck.rs
workspace.rs