clippy_utils

Function is_expr_untyped_identity_function

source
pub fn is_expr_untyped_identity_function(
    cx: &LateContext<'_>,
    expr: &Expr<'_>,
) -> bool
Expand description

This is the same as is_expr_identity_function, but does not consider closures with type annotations for its bindings (or similar) as identity functions:

  • |x: u8| x
  • std::convert::identity::<u8>