Skip to content

Commit

Permalink
Merge pull request #12 from redforks/master
Browse files Browse the repository at this point in the history
Fix clippy::needless_update
  • Loading branch information
Lymia authored Jan 4, 2025
2 parents 553387b + e12e428 commit 5512c2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,9 @@ fn generate_setter_method(
} else {
Ok(quote! {
#field_doc
pub fn #setter_name (self, #params) -> Self {
#container_name { #field_name: #expr, ..self }
pub fn #setter_name (mut self, #params) -> Self {
self.#field_name = #expr;
self
}
})
}
Expand Down

0 comments on commit 5512c2e

Please sign in to comment.