-
Notifications
You must be signed in to change notification settings - Fork 1
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!: Implement support for generic params #17
base: main
Are you sure you want to change the base?
Conversation
…write of the macro expansion.
…. WIP: Make macros work with traits.
… TODO: check parsing of trait-inner type-generic attributes on functions
…O: check parsing of trait-inner type-generic attributes on functions
Hello, @scouten. Ready for review |
Should be marked as "Closes #16" |
Needs to be new major, because async_signature now requires to explicitly specify or not specify the return type
I need to add support for |
Or rather, attributes on |
…utes on `async_signature`
Battle-testing the implementation on |
@DanikVitek this looks very interesting. I'll want to make sure the CI runs pass before merging and also for you to add the Let me know how I can help. |
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.
Great and welcome proposal! I look forward to the final draft as discussed in my initial comments.
macros/Cargo.toml
Outdated
@@ -1,6 +1,6 @@ | |||
[package] | |||
name = "async-generic" | |||
version = "1.1.2" |
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.
Please remove this diff. This project uses release-plz
(https://release-plz.dev/docs) to manage versioning and that infrastructure will automatically do the necessary updates at the time based on how the PR is labeled.
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.
I'm also questioning whether this PR meets the criteria for bumping to a 2.0. Under the rules of semantic versioning, that should only happen if there's an incompatible API change to the library. I see changes you've made to the async_signature
parameter of the macro, but do the break compatibility? If not, let's make this a 1.2.0 release (which would involve removing the !
from the PR title as I've amended it).
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.
as I've described in the description of the commit 6d1b01e, the changes are indeed breaking.
async_signature(a: B)
means, that the async
function does not have a return type, while previously this meta tag affected only the input arguments
…ersions, storing only respective kind of functions, and llow to specify custom trait bounds on async version
I might also add the |
I need to add new features behind feature flags? |
@DanikVitek no, I wasn't talking about Rust crate feature flags. What I was referring to was the Conventional Commits syntax, which is required in this project for all pull requests. I've updated the PR title to be compliant, but if this is not a breaking change, then we should remove the |
Now that I think about it, what are the reasons anybody would want to change the return type of their async function relative to the sync function? The only real reason I can come up with is if they're using a custom |
I'm sorry, then I'm not sure what you meant by me adding the |
Also:
Closes #16.