aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics
diff options
context:
space:
mode:
authorivan770 <[email protected]>2020-12-09 08:22:13 +0000
committerGitHub <[email protected]>2020-12-09 08:22:13 +0000
commit35006eba79b9a445c4ebec66f1a93b3170398e0e (patch)
treecc9a6651ada6c6bf8d6a842e8389878819bb0259 /crates/hir_ty/src/diagnostics
parent86c183716cc6dfd44da15c86a7726d0a117c214e (diff)
Apply rustfmt changes
Diffstat (limited to 'crates/hir_ty/src/diagnostics')
-rw-r--r--crates/hir_ty/src/diagnostics/expr.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs
index 27ffcf291..9e461e0b0 100644
--- a/crates/hir_ty/src/diagnostics/expr.rs
+++ b/crates/hir_ty/src/diagnostics/expr.rs
@@ -334,11 +334,12 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
334 None => return, 334 None => return,
335 }; 335 };
336 336
337 let possible_tail_ty = if let Some(possible_tail_ty) = self.infer.type_of_expr.get(possible_tail_id) { 337 let possible_tail_ty =
338 possible_tail_ty 338 if let Some(possible_tail_ty) = self.infer.type_of_expr.get(possible_tail_id) {
339 } else { 339 possible_tail_ty
340 return; 340 } else {
341 }; 341 return;
342 };
342 343
343 if mismatch.actual != Ty::unit() || mismatch.expected != *possible_tail_ty { 344 if mismatch.actual != Ty::unit() || mismatch.expected != *possible_tail_ty {
344 return; 345 return;
@@ -346,10 +347,8 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
346 347
347 let (_, source_map) = db.body_with_source_map(self.owner.into()); 348 let (_, source_map) = db.body_with_source_map(self.owner.into());
348 if let Ok(source_ptr) = source_map.expr_syntax(possible_tail_id) { 349 if let Ok(source_ptr) = source_map.expr_syntax(possible_tail_id) {
349 self.sink.push(RemoveThisSemicolon { 350 self.sink
350 file: source_ptr.file_id, 351 .push(RemoveThisSemicolon { file: source_ptr.file_id, expr: source_ptr.value });
351 expr: source_ptr.value,
352 });
353 } 352 }
354 } 353 }
355} 354}