-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
feat(next): keep original string on unknown variants #612
feat(next): keep original string on unknown variants #612
Conversation
d808a99
to
b0eb447
Compare
Thanks for doing this. I am for it but I will let @mzeitlin11 pull the trigger |
Thanks @lasantosr! Main initial question is both the purpose of the |
The purpose of I thought about replacing the implementation, removing I didn't consider timing, so I can update the PR with one of the following, or any other you might consider (for enums with unknown variant only):
|
I think it is reasonable to clone in the exceptional case of encountering an unknown string. When calling stripe apis the bottleneck will be the network (meaning the additional resource cost of a clone is negligible). So my vote is option 1. |
I also like 1 for the reasons given above too. The |
@lasantosr ping me here when you have removed the impl and I will get it released :) |
b0eb447
to
d4583c2
Compare
@arlyon I've updated the PR removing the |
Hey @arlyon it's been a while, ¿could you have a look at this and the other |
Sorry for the delay @lasantosr, if Alexander doesn't get to it by next weekend I should have more time then to review. For now, I just reran the CI jobs to see if happens again |
Looks like the weird errors went away, now just a |
d4583c2
to
feb39af
Compare
Thanks @mzeitlin11! It was by bad, it's fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lasantosr!
Summary
This PR aims to keep the original values for unknown variants, if they are generated.
This allows downstream crates to act on them, for example logging the unexpected value. This is useful for example on the
ApiVersion
for the webhook versioning, in order to be able to properly determine if the event comes from a newer api version.Checklist