Module clippy_utils::eager_or_lazy [−][src]
Expand description
Utilities for evaluating whether eagerly evaluated expressions can be made lazy and vice versa.
Things to consider:
- has the expression side-effects?
- is the expression computationally expensive?
See lints:
- unnecessary-lazy-evaluations
- or-fun-call
- option-if-let-else
Functions
Identify some potentially computationally expensive patterns. This function is named so to stress that its implementation is non-exhaustive. It returns FNs and FPs.
Is the expr pure (is it free from side-effects)? This function is named so to stress that it isn’t exhaustive and returns FNs.