@@ -66,11 +66,11 @@ impl<'a> RuleMut<'a> for ForStatementCondition {
6666 node : & mut crate :: tree:: NodeMut < ' a , Self :: Language > ,
6767 _flow : crate :: tree:: ControlFlow ,
6868 ) -> crate :: error:: MinusOneResult < ( ) > {
69- if matches ! ( node. view( ) . kind( ) , "while_statement" | "for_statement" ) {
70- if node. start_transaction ( ) . is_ok ( ) {
71- // Save the loop id to close the transaction
72- self . loop_id = Some ( node . id ( ) ) ;
73- }
69+ if matches ! ( node. view( ) . kind( ) , "while_statement" | "for_statement" )
70+ && node. start_transaction ( ) . is_ok ( )
71+ {
72+ // Save the loop id to close the transaction
73+ self . loop_id = Some ( node . id ( ) ) ;
7474 }
7575
7676 Ok ( ( ) )
@@ -161,7 +161,7 @@ impl<'a> RuleMut<'a> for ForStatementFlowControl {
161161 . unwrap ( )
162162 . iter ( )
163163 . skip_while ( |n| n. id ( ) != view. id ( ) )
164- . map ( |n| n. id ( ) . clone ( ) )
164+ . map ( |n| n. id ( ) )
165165 . collect ( ) ;
166166 for id in following_children_ids {
167167 node. set_by_node_id ( id, Powershell :: DeadCode ) ;
@@ -184,7 +184,7 @@ impl<'a> RuleMut<'a> for ForStatementFlowControl {
184184 if let Some ( iterator_variable) = self
185185 . iterators
186186 . iter_mut ( )
187- . find ( |n| n. name == view. text ( ) . unwrap ( ) . to_string ( ) )
187+ . find ( |n| n. name == view. text ( ) . unwrap ( ) )
188188 {
189189 iterator_variable. references . push ( node. id ( ) ) ;
190190 }
0 commit comments