diff options
Diffstat (limited to 'crates/ra_hir_expand/src')
-rw-r--r-- | crates/ra_hir_expand/src/diagnostics.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_hir_expand/src/diagnostics.rs b/crates/ra_hir_expand/src/diagnostics.rs index 8358c488b..e58defa68 100644 --- a/crates/ra_hir_expand/src/diagnostics.rs +++ b/crates/ra_hir_expand/src/diagnostics.rs | |||
@@ -72,9 +72,12 @@ impl<'a> DiagnosticSinkBuilder<'a> { | |||
72 | self | 72 | self |
73 | } | 73 | } |
74 | 74 | ||
75 | pub fn on<D: Diagnostic, F: FnMut(&D) -> Option<()> + 'a>(mut self, mut cb: F) -> Self { | 75 | pub fn on<D: Diagnostic, F: FnMut(&D) + 'a>(mut self, mut cb: F) -> Self { |
76 | let cb = move |diag: &dyn Diagnostic| match diag.as_any().downcast_ref::<D>() { | 76 | let cb = move |diag: &dyn Diagnostic| match diag.as_any().downcast_ref::<D>() { |
77 | Some(d) => cb(d).ok_or(()), | 77 | Some(d) => { |
78 | cb(d); | ||
79 | Ok(()) | ||
80 | } | ||
78 | None => Err(()), | 81 | None => Err(()), |
79 | }; | 82 | }; |
80 | self.callbacks.push(Box::new(cb)); | 83 | self.callbacks.push(Box::new(cb)); |