···4747 };
48484949 let lambda_expr = Lambda::cast(node.clone())?;
5050- let arg_node = lambda_expr.arg()?;
5151- let arg = Ident::cast(arg_node)?;
5252- let body_node = lambda_expr.body()?;
5353- let body = Apply::cast(body_node)?;
5454- let value_node = body.value()?;
5555- let value = Ident::cast(value_node)?;
5050+ let ident = Ident::cast(lambda_expr.arg()?)?;
5151+ let body = Apply::cast(lambda_expr.body()?)?;
56525757- if arg.as_str() != value.as_str() {
5353+ if ident.as_str() != Ident::cast(body.value()?)?.as_str() {
5854 return None;
5955 }
60566157 let lambda_node = body.lambda()?;
62586363- if mentions_ident(&arg, &lambda_node) {
5959+ if mentions_ident(&ident, &lambda_node) {
6460 return None;
6561 }
6662