Skip to content

Commit

Permalink
Suppress clippy::diverging_sub_expression in generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 committed Sep 21, 2023
1 parent 3b51074 commit e2c105f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions macros/src/throws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@ impl Fold for Throws {

fn make_fn_block(ty: &syn::Type, inner: &syn::Block) -> syn::Block {
let mut block: syn::Block = syn::parse2(quote::quote! {{
let __ret = #inner;
#[allow(clippy::diverging_sub_expression)]
{
let __ret = { #inner };

#[allow(unreachable_code)]
<#ty as ::culpa::__internal::_Succeed>::from_ok(__ret)
#[allow(unreachable_code)]
<#ty as ::culpa::__internal::_Succeed>::from_ok(__ret)
}
}})
.unwrap();
block.brace_token = inner.brace_token;
Expand Down

0 comments on commit e2c105f

Please sign in to comment.