From cf4de8d29e2dea103c14081fdaff74d57db18ba6 Mon Sep 17 00:00:00 2001 From: Aleksey Yakovlev Date: Fri, 7 Jun 2024 14:43:19 +0700 Subject: [PATCH] clippy fix --- src/compiler/cst/parser.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/cst/parser.rs b/src/compiler/cst/parser.rs index b166d86..26b4a7c 100644 --- a/src/compiler/cst/parser.rs +++ b/src/compiler/cst/parser.rs @@ -231,10 +231,9 @@ fn parse_atom_function_into(node: &AstNode, buf: &mut Vec) -> Result<() fn parse_atom_fn_params(node: &AstNode) -> Result, CstParserError> { guard_node_type(node, AstNodeType::AtomFnParams)?; - let mut param_counter = 0; let mut buf = Vec::new(); - for child in &node.children { + for (param_counter, child) in node.children.iter().enumerate() { guard_node_type(child, AstNodeType::AtomFnParam)?; let mut value = Vec::new(); @@ -246,7 +245,6 @@ fn parse_atom_fn_params(node: &AstNode) -> Result, CstPa name: param_counter.to_string(), value, }); - param_counter += 1; } Ok(buf)