internal: refactor remove this semicolon diagnostics

This commit is contained in:
Aleksey Kladov 2021-06-13 20:13:15 +03:00
parent 8d391ec981
commit 74f3cca85a
8 changed files with 71 additions and 83 deletions

View file

@ -1184,10 +1184,7 @@ impl Function {
}
BodyValidationDiagnostic::RemoveThisSemicolon { expr } => {
match source_map.expr_syntax(expr) {
Ok(source_ptr) => sink.push(RemoveThisSemicolon {
file: source_ptr.file_id,
expr: source_ptr.value,
}),
Ok(expr) => acc.push(RemoveThisSemicolon { expr }.into()),
Err(SyntheticSyntax) => (),
}
}