collapsing if statement

This commit is contained in:
jnyfah 2025-02-06 16:18:15 +01:00
parent 4522bf42ca
commit 6b328750e5

View File

@ -36,11 +36,9 @@ pub(super) fn hints(
if it.ty().is_some() { if it.ty().is_some() {
return None; return None;
} }
if config.hide_closure_parameter_hints { if config.hide_closure_parameter_hints && it.syntax().ancestors().any(|n| matches!(ast::Expr::cast(n), Some(ast::Expr::ClosureExpr(_)))) {
if it.syntax().ancestors().any(|n| matches!(ast::Expr::cast(n), Some(ast::Expr::ClosureExpr(_)))) {
return None; return None;
} }
}
Some(it.colon_token()) Some(it.colon_token())
}, },
ast::LetStmt(it) => { ast::LetStmt(it) => {