pub(crate) fn is_body_identity_function(
    cx: &LateContext<'_>,
    func: &Body<'_>
) -> bool
Expand description

Checks if a function’s body represents the identity function. Looks for bodies of the form:

  • |x| x
  • |x| return x
  • |x| { return x }
  • |x| { return x; }