2 As the counterpart to `or_fun_call`, this lint looks for unnecessary
3 lazily evaluated closures on `Option` and `Result`.
5 This lint suggests changing the following functions, when eager evaluation results in
7 - `unwrap_or_else` to `unwrap_or`
10 - `get_or_insert_with` to `get_or_insert`
11 - `ok_or_else` to `ok_or`
14 Using eager evaluation is shorter and simpler in some cases.
17 It is possible, but not recommended for `Deref` and `Index` to have
18 side effects. Eagerly evaluating them can change the semantics of the program.
22 // example code where clippy issues a warning
23 let opt: Option<u32> = None;
25 opt.unwrap_or_else(|| 42);
29 let opt: Option<u32> = None;