Skip to content

{flat_,}map_identity: recognize (tuple) struct de- and restructuring #15261

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ada4a
Copy link
Contributor

@ada4a ada4a commented Jul 12, 2025

Follow-up of #15229, as described in #15229 (comment) -- it turned out to be not that difficult after all!

changelog: [map_identity,flat_map_identity]: also recognize (tuple) struct de- and resctructuring

r? @y21

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 12, 2025
ada4a added 9 commits July 13, 2025 16:08
makes the code a bit more concise by removing the need for explicit
`.iter()`
the match arms above put the "sanity" checks in the guard, and call only
`check_pat` in the body. With this commit, the (tuple) struct cases
follow that convention as well. Well, almost -- I think the ident check
belongs to the second category of checks, so I put it in the body as
well
this'll probably be marginally faster thanks to the equality check being
now structural
@ada4a ada4a force-pushed the map-identity-struct branch from 156c025 to f73c961 Compare July 13, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants