Skip to content

Commit

Permalink
Preserve defaults for type parameters
Browse files Browse the repository at this point in the history
Fixes #282
  • Loading branch information
TedDriggs committed Feb 28, 2023
1 parent 52f9adc commit 9aa7bc8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion derive_builder_core/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ impl<'a> ToTokens for Builder<'a> {
let builder_ident = &self.ident;
let bounded_generics = self.compute_impl_bounds();
let (impl_generics, _, _) = bounded_generics.split_for_impl();
let (struct_generics, ty_generics, where_clause) = self.generics.split_for_impl();
// Use the full generics for struct_generics to include defaults for
// generics. The output of split_for_impl doesn't include these, so
// we don't use those at all.
let struct_generics = self.generics;
let (_, ty_generics, where_clause) = self.generics.split_for_impl();
let builder_fields = &self.fields;
let builder_field_initializers = &self.field_initializers;
let create_empty = &self.create_empty;
Expand Down

0 comments on commit 9aa7bc8

Please sign in to comment.