Skip to content

Commit

Permalink
Fix #113: Add #[allow(clippy::used_underscore_binding)] to build me…
Browse files Browse the repository at this point in the history
…thod and setter methods
  • Loading branch information
idanarye committed Sep 18, 2023
1 parent 30bf3fa commit a820f75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Add `#[allow(clippy::exhaustive_enums)]` to generated empty enums used for
error "reporting" (see issue #112)
- Add `#[automatically_derived]` to generated `impl`s (see issue #114)
- Add `#[allow(clippy::used_underscore_binding)]` to build method and setter
methods (see issue #113)

## 0.16.0 - 2023-08-26
### Added
Expand Down
3 changes: 2 additions & 1 deletion typed-builder-macro/src/struct_info.rs
Expand Up @@ -272,6 +272,7 @@ impl<'a> StructInfo<'a> {
impl #impl_generics #builder_name < #( #ty_generics ),* > #where_clause {
#deprecated
#doc
#[allow(clippy::used_underscore_binding)]
pub fn #method_name (self, #param_list) -> #builder_name <#( #target_generics ),*> {
let #field_name = (#arg_expr,);
let ( #(#descructuring,)* ) = self.fields;
Expand Down Expand Up @@ -497,7 +498,7 @@ impl<'a> StructInfo<'a> {
#[automatically_derived]
impl #impl_generics #builder_name #modified_ty_generics #where_clause {
#build_method_doc
#[allow(clippy::default_trait_access)]
#[allow(clippy::default_trait_access, clippy::used_underscore_binding)]
#build_method_visibility fn #build_method_name #build_method_generic (self) -> #output_type #build_method_where_clause {
let ( #(#descructuring,)* ) = self.fields;
#( #assignments )*
Expand Down

0 comments on commit a820f75

Please sign in to comment.