Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#100921 - ChayimFriedman2:and-eager-eval, r=…
…JohnTitor 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()`](rust-lang#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.
- Loading branch information