From 6c42f2c475321462a0a452d93f4e40c4dbace0e5 Mon Sep 17 00:00:00 2001 From: sholderbach Date: Thu, 25 Jul 2024 21:44:28 +0200 Subject: [PATCH] Contentious lint to contract into single `if let` --- crates/nu-parser/src/parse_keywords.rs | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/nu-parser/src/parse_keywords.rs b/crates/nu-parser/src/parse_keywords.rs index 3e2b1827b2..990ad43e7c 100644 --- a/crates/nu-parser/src/parse_keywords.rs +++ b/crates/nu-parser/src/parse_keywords.rs @@ -308,21 +308,21 @@ pub fn parse_for(working_set: &mut StateWorkingSet, lite_command: &LiteCommand) } // Let's get our block and make sure it has the right signature - if let Some(arg) = call.positional_nth(2) { - match arg { - Expression { - expr: Expr::Block(block_id), - .. - } - | Expression { - expr: Expr::RowCondition(block_id), - .. - } => { - let block = working_set.get_block_mut(*block_id); + if let Some( + Expression { + expr: Expr::Block(block_id), + .. + } + | Expression { + expr: Expr::RowCondition(block_id), + .. + }, + ) = call.positional_nth(2) + { + { + let block = working_set.get_block_mut(*block_id); - block.signature = Box::new(sig); - } - _ => {} + block.signature = Box::new(sig); } }