rust/library/core
Yuki Okushi df354f5cf6
Rollup merge of #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()`](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.
2022-08-25 08:50:59 +09:00
..
benches Rename integer log* methods to ilog* 2022-08-09 10:20:49 -07:00
primitive_docs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
src Rollup merge of #100921 - ChayimFriedman2:and-eager-eval, r=JohnTitor 2022-08-25 08:50:59 +09:00
tests Rollup merge of #100220 - scottmcm:fix-by-ref-sized, r=joshtriplett 2022-08-24 18:20:08 +02:00
Cargo.toml Avoid use of rand::thread_rng in stdlib benchmarks 2022-05-02 00:08:21 -07:00