fix(derive): Code is no longer required

This commit is contained in:
Kat Marchán 2021-09-17 11:33:39 -07:00
parent 9841d6fd77
commit 92a3150921
1 changed files with 4 additions and 5 deletions

View File

@ -66,15 +66,14 @@ impl WhichFn {
Self::Snippets => quote! {
fn snippets(&self) -> std::option::Option<std::boxed::Box<dyn std::iter::Iterator<Item = miette::DiagnosticSnippet> + '_>>
},
Self::Related => quote! {
fn related<'a>(&'a self) -> std::option::Option<std::boxed::Box<dyn std::iter::Iterator<Item = &'a dyn miette::Diagnostic> + 'a>>
},
}
}
pub fn catchall_arm(&self) -> TokenStream {
match self {
// required, hence method can't return None
Self::Code => quote! {},
_ => quote! { _ => None, },
}
quote! { _ => std::option::Option::None }
}
}