From e497c9fffd54578d442d1c726f371ad3c7ccb8b7 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Fri, 29 Nov 2024 16:25:39 +0100 Subject: [PATCH] chore: simplify indentation --- src/rules/jsx_key.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/rules/jsx_key.rs b/src/rules/jsx_key.rs index 82f5f6ec..31016dc6 100644 --- a/src/rules/jsx_key.rs +++ b/src/rules/jsx_key.rs @@ -98,15 +98,17 @@ impl Handler for JSXKeyHandler { check_callback(ctx, &callback.expr) } } else if let Expr::Member(member) = callee { - if let Expr::Ident(id) = member.obj { - if id.sym() == "Array" { - if let MemberProp::Ident(member_id) = member.prop { - if member_id.sym() == "from" { - if let Some(el) = node.args.get(1) { - check_callback(ctx, &el.expr); - } - } - } + let Expr::Ident(id) = member.obj else { + return; + }; + + let MemberProp::Ident(member_id) = member.prop else { + return; + }; + + if id.sym() == "Array" && member_id.sym() == "from" { + if let Some(el) = node.args.get(1) { + check_callback(ctx, &el.expr); } } }