Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_ty/src/tests.rs')
-rw-r--r--crates/hir_ty/src/tests.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/hir_ty/src/tests.rs b/crates/hir_ty/src/tests.rs
index cf6833e56a..29250dca00 100644
--- a/crates/hir_ty/src/tests.rs
+++ b/crates/hir_ty/src/tests.rs
@@ -195,10 +195,9 @@ fn check_impl(ra_fixture: &str, allow_none: bool, only_types: bool, display_sour
mismatch.expected.display_test(&db),
mismatch.actual.display_test(&db)
);
- if let Some(annotation) = mismatches.remove(&range) {
- assert_eq!(actual, annotation);
- } else {
- format_to!(unexpected_type_mismatches, "{:?}: {}\n", range.range, actual);
+ match mismatches.remove(&range) {
+ Some(annotation) => assert_eq!(actual, annotation),
+ None => format_to!(unexpected_type_mismatches, "{:?}: {}\n", range.range, actual),
}
}
for (expr, mismatch) in inference_result.expr_type_mismatches() {
@@ -215,10 +214,9 @@ fn check_impl(ra_fixture: &str, allow_none: bool, only_types: bool, display_sour
mismatch.expected.display_test(&db),
mismatch.actual.display_test(&db)
);
- if let Some(annotation) = mismatches.remove(&range) {
- assert_eq!(actual, annotation);
- } else {
- format_to!(unexpected_type_mismatches, "{:?}: {}\n", range.range, actual);
+ match mismatches.remove(&range) {
+ Some(annotation) => assert_eq!(actual, annotation),
+ None => format_to!(unexpected_type_mismatches, "{:?}: {}\n", range.range, actual),
}
}
}