Module eager_or_lazy

Source
Expand description

Utilities for evaluating whether eagerly evaluated expressions can be made lazy and vice versa.

Things to consider:

  • does the expression have side-effects?
  • is the expression computationally expensive?

See lints:

  • unnecessary-lazy-evaluations
  • or-fun-call
  • option-if-let-else

Enumsยง

EagernessSuggestion ๐Ÿ”’

Functionsยง

expr_eagerness ๐Ÿ”’
fn_eagerness ๐Ÿ”’
Determine the eagerness of the given function call.
res_has_significant_drop ๐Ÿ”’
switch_to_eager_eval
Whether the given expression should be changed to evaluate eagerly
switch_to_lazy_eval
Whether the given expression should be changed to evaluate lazily