mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 22:53:28 +00:00
df354f5cf6
Add a warning about `Option/Result::and()` being eagerly evaluated Copied from `or()`. Inspired by [this StackOverflow question](https://stackoverflow.com/questions/73461846/why-is-in-rust-the-expression-in-option-and-evaluated-if-option-is-none). [The PR for `or()`](https://github.com/rust-lang/rust/pull/46548) mentions the Clippy lint `or_fun_call` which doesn't exist for `and()` (although there is `unnecessary_lazy_evaluations`). I still think this warning is also good for `and()`. Feel free to close if you disagree. |
||
---|---|---|
.. | ||
benches | ||
primitive_docs | ||
src | ||
tests | ||
Cargo.toml |