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

Fix unused variable warning when field of adjacently tagged enum is skipped #1617

Merged
merged 1 commit into from Sep 16, 2019
Merged

Conversation

arilotter
Copy link
Contributor

Replace skip_seralizing tuple members with _ in generated serializer.
I'm not totally convinced this is the right solution, since it requires creating 2x the Vecs, but it's the most "correct" solution I've found.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I am concerned how much this change makes the implementation of this function harder to read and understand. How about simply putting #[allow(unused_variables)] on the let statement, with a comment?

@arilotter
Copy link
Contributor Author

I agree! I wrote a message in the #serde irc channel asking if #[allow(unused_variables)] was the way to go, but I thought I'd try without it in case y'all wanted to avoid that :)

I'm very happy to make the fix a simple warning suppression, now my project will finally compile with no warnings :D 🙏

@dtolnay dtolnay changed the title Bug fix for #1610 Fix unused variable warning when field of adjacently tagged enum is skipped Sep 8, 2019
Allow unused variables in tuple in AdjacentlyTagged serializer
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants