fix(derive): allow unused variables for the snippets method

This commit is contained in:
Kat Marchán 2021-08-16 23:10:08 -07:00
parent ee2e2d1ef2
commit f704d6a9ae
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
1 changed files with 2 additions and 0 deletions

View File

@ -261,6 +261,7 @@ impl Snippets {
}
});
Some(quote! {
#[allow(unused_variables)]
fn snippets(&self) -> std::option::Option<std::boxed::Box<dyn std::iter::Iterator<Item = miette::DiagnosticSnippet>>> {
Some(Box::new(vec![
#(#snippets),*
@ -398,6 +399,7 @@ impl Snippets {
})
});
Some(quote! {
#[allow(unused_variables)]
fn snippets(&self) -> std::option::Option<std::boxed::Box<dyn std::iter::Iterator<Item = miette::DiagnosticSnippet>>> {
match self {
#(#variant_arms)*