diff options
author | Aleksey Kladov <[email protected]> | 2021-06-13 18:32:54 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-06-13 18:32:54 +0100 |
commit | de1fc70ccd3bf7a0850e036a12cf866a80d46458 (patch) | |
tree | d93cc6be7678b8be01a5162e80bb3f8df84e8c50 /crates/hir/src/lib.rs | |
parent | 24262f9ff6ae9ea326fa35d238704d18e99d52a1 (diff) |
internal: refactor find_map diagnostic
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r-- | crates/hir/src/lib.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index aaab5336a..b2731b62f 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -1168,10 +1168,13 @@ impl Function { | |||
1168 | } | 1168 | } |
1169 | BodyValidationDiagnostic::ReplaceFilterMapNextWithFindMap { method_call_expr } => { | 1169 | BodyValidationDiagnostic::ReplaceFilterMapNextWithFindMap { method_call_expr } => { |
1170 | if let Ok(next_source_ptr) = source_map.expr_syntax(method_call_expr) { | 1170 | if let Ok(next_source_ptr) = source_map.expr_syntax(method_call_expr) { |
1171 | sink.push(ReplaceFilterMapNextWithFindMap { | 1171 | acc.push( |
1172 | file: next_source_ptr.file_id, | 1172 | ReplaceFilterMapNextWithFindMap { |
1173 | next_expr: next_source_ptr.value, | 1173 | file: next_source_ptr.file_id, |
1174 | }); | 1174 | next_expr: next_source_ptr.value, |
1175 | } | ||
1176 | .into(), | ||
1177 | ); | ||
1175 | } | 1178 | } |
1176 | } | 1179 | } |
1177 | BodyValidationDiagnostic::MismatchedArgCount { call_expr, expected, found } => { | 1180 | BodyValidationDiagnostic::MismatchedArgCount { call_expr, expected, found } => { |