Skip to content

Commit e23d5ef

Browse files
giacomocavalierilpil
authored andcommitted
rename stmt to statement
1 parent 4dd6de6 commit e23d5ef

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

compiler-core/src/ast/visit.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ pub trait Visit<'ast> {
344344
visit_typed_expr_invalid(self, location, type_, extra_information);
345345
}
346346

347-
fn visit_typed_statement(&mut self, stmt: &'ast TypedStatement) {
348-
visit_typed_statement(self, stmt);
347+
fn visit_typed_statement(&mut self, statement: &'ast TypedStatement) {
348+
visit_typed_statement(self, statement);
349349
}
350350

351351
fn visit_typed_assignment(&mut self, assignment: &'ast TypedAssignment) {
@@ -961,8 +961,8 @@ pub fn visit_typed_expr_block<'a, V>(
961961
) where
962962
V: Visit<'a> + ?Sized,
963963
{
964-
for stmt in statements {
965-
v.visit_typed_statement(stmt);
964+
for statement in statements {
965+
v.visit_typed_statement(statement);
966966
}
967967
}
968968

@@ -1022,8 +1022,8 @@ pub fn visit_typed_expr_fn<'a, V>(
10221022
v.visit_type_ast(return_);
10231023
}
10241024

1025-
for stmt in body {
1026-
v.visit_typed_statement(stmt);
1025+
for statement in body {
1026+
v.visit_typed_statement(statement);
10271027
}
10281028
}
10291029

@@ -1241,12 +1241,12 @@ where
12411241
v.visit_typed_expr(value);
12421242
}
12431243

1244-
pub fn visit_typed_statement<'a, V>(v: &mut V, stmt: &'a TypedStatement)
1244+
pub fn visit_typed_statement<'a, V>(v: &mut V, statement: &'a TypedStatement)
12451245
where
12461246
V: Visit<'a> + ?Sized,
12471247
{
1248-
match stmt {
1249-
Statement::Expression(expr) => v.visit_typed_expr(expr),
1248+
match statement {
1249+
Statement::Expression(expression) => v.visit_typed_expr(expression),
12501250
Statement::Assignment(assignment) => v.visit_typed_assignment(assignment),
12511251
Statement::Use(use_) => v.visit_typed_use(use_),
12521252
Statement::Assert(assert) => v.visit_typed_assert(assert),

compiler-core/src/language_server/code_action.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,11 +2793,11 @@ impl<'a> ExtractVariable<'a> {
27932793
}
27942794

27952795
impl<'ast> ast::visit::Visit<'ast> for ExtractVariable<'ast> {
2796-
fn visit_typed_statement(&mut self, stmt: &'ast TypedStatement) {
2797-
let range = self.edits.src_span_to_lsp_range(stmt.location());
2796+
fn visit_typed_statement(&mut self, statement: &'ast TypedStatement) {
2797+
let range = self.edits.src_span_to_lsp_range(statement.location());
27982798
if !within(self.params.range, range) {
2799-
self.latest_statement = Some(stmt.location());
2800-
ast::visit::visit_typed_statement(self, stmt);
2799+
self.latest_statement = Some(statement.location());
2800+
ast::visit::visit_typed_statement(self, statement);
28012801
return;
28022802
}
28032803

@@ -2808,17 +2808,17 @@ impl<'ast> ast::visit::Visit<'ast> for ExtractVariable<'ast> {
28082808
Some(ExtractVariablePosition::InsideCaptureBody) => {}
28092809
Some(ExtractVariablePosition::PipelineCall) => {
28102810
// Insert above the pipeline start
2811-
self.latest_statement = Some(stmt.location());
2811+
self.latest_statement = Some(statement.location());
28122812
}
28132813
_ => {
28142814
// Insert below the previous statement
2815-
self.latest_statement = Some(stmt.location());
2815+
self.latest_statement = Some(statement.location());
28162816
self.statement_before_selected_expression = self.latest_statement;
28172817
}
28182818
}
28192819

28202820
self.at_position(ExtractVariablePosition::TopLevelStatement, |this| {
2821-
ast::visit::visit_typed_statement(this, stmt);
2821+
ast::visit::visit_typed_statement(this, statement);
28222822
});
28232823
}
28242824

0 commit comments

Comments
 (0)