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 name collisions #152

Merged
merged 2 commits into from
Sep 12, 2024
Merged

Fix name collisions #152

merged 2 commits into from
Sep 12, 2024

Conversation

davidpdrsn
Copy link
Contributor

Checklist

  • I have read the Contributor Guide
  • I have read and agree to the Code of Conduct
  • I have added a description of my changes and why I'd like them included in the section below

Description of Changes

If you had an enum variant with a field called name then methods like field and field_mut wouldn't work due to variable name collisions in the generated code. This fixes that by prefixing generated variable names with __mirror_mirror.

@davidpdrsn davidpdrsn merged commit f6f3201 into v0.2.0 Sep 12, 2024
5 checks passed
@davidpdrsn davidpdrsn deleted the david/fix-name-collisions branch September 12, 2024 13:44
davidpdrsn added a commit that referenced this pull request Sep 12, 2024
### Checklist

* [x] I have read the [Contributor Guide](../../CONTRIBUTING.md)
* [x] I have read and agree to the [Code of
Conduct](../../CODE_OF_CONDUCT.md)
* [x] I have added a description of my changes and why I'd like them
included in the section below

### Description of Changes

If you had an enum variant with a field called `name` then methods like
`field` and `field_mut` wouldn't work due to variable name collisions in
the generated code. This fixes that by prefixing generated variable
names with `__mirror_mirror`.
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.

1 participant