-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Newtypes for IDs #84
Comments
Thank you for your issue! Overall I'm supportive of the idea. At the very least it can make it easier to ensure all ids are using the correct type (it's currently inconsistent). In terms of implementation I think my preference would be for a macro_rules macro which creates the types for each of the structs, so that they can all share the same methods, while still being distinct types. |
What methods do the newtypes need though? #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] and maybe Ord/PartialOrd is all I can think of. |
Well they'll need ways to extract and map the raw IDs, I don't think the type should be completely opaque, so I think we should have methods and trait impls such as |
I would just make the inner number |
I mean would also do that. I think it's important for it to be flexible as there are different cases where one style is more preferable than the other. |
I see you've made ids be mostly |
Another question: what is |
If there was a reason, I have since forgot it, so feel free to disregard the current setup and make everything |
* Use newtypes for Github API IDs Resolves #84 * Bump version due to incompatible API change for IDs * address review comments
Seems to me it would be nice to have newtypes for the different IDs (orgs, users, check runs, workflow runs, etc). That would be an API break though. How do you feel about that?
The text was updated successfully, but these errors were encountered: