Skip to content

Commit

Permalink
Update documentation and clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
speelbarrow committed Jul 25, 2023
1 parent 35e2ee5 commit db13cb4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ pub fn enum_from_functions(args: TokenStream, input: TokenStream) -> TokenStream
}
}

// Define variables needed for `quote` to generate the output.
let enum_name = &parsed_impl.self_ty;
if let Some(item) = first_sig.map(|some| {
let mut sig = some.clone();
Expand All @@ -267,14 +268,15 @@ pub fn enum_from_functions(args: TokenStream, input: TokenStream) -> TokenStream
}) {
parsed_impl.items.push(item)
}
let out = quote::quote! {

// Generate and return the output.
quote::quote! {
#(#attrs)*
#parsed_pub enum #enum_name {
#(#variants),*
}

#parsed_impl
};

out.into()
}
.into()
}

0 comments on commit db13cb4

Please sign in to comment.