Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly match unit type inside generated setters #110

Merged
merged 1 commit into from
Aug 13, 2023

Conversation

aumetra
Copy link
Contributor

@aumetra aumetra commented Aug 13, 2023

This PR changes the usage of _ to () inside setters.

When implementing a setter, the code will expand to something like this:

let (field, _) = self.fields;

While this is fine, with Rust 1.73 Clippy will introduce a new pedantic lint ignored_unit_patterns.
This will result in warnings on each usage of the TypedBuilder macro.

With this one-line change, the expanded code will change to something like this:

let (field, ()) = self.fields;

@aumetra aumetra changed the title Explicitly match unit type Explicitly match unit type inside generated setters Aug 13, 2023
@idanarye idanarye merged commit 628786a into idanarye:master Aug 13, 2023
9 checks passed
@aumetra aumetra deleted the match-unit-type branch August 13, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants