Skip to content

Commit

Permalink
fix(derive): Code is no longer required
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Sep 22, 2021
1 parent 9841d6f commit 92a3150
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions miette-derive/src/forward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
}

Expand Down

0 comments on commit 92a3150

Please sign in to comment.