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: reexport async_trait::async_trait #74

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

tamaroning
Copy link
Contributor

This PR

To create a new provider using this library, we need to use the #[async_trait] macro to impl traits.

Related Issues

Notes

Follow-up Tasks

none

How to test

none

@tamaroning tamaroning force-pushed the reexport-async-trait branch 2 times, most recently from a85e878 to 70204b7 Compare April 24, 2024 17:54
Signed-off-by: Raiki Tamura <tamaron1203@gmail.com>
@tamaroning tamaroning force-pushed the reexport-async-trait branch from 70204b7 to 1a65f9d Compare April 24, 2024 17:54
@beeme1mr beeme1mr requested a review from sheepduke April 24, 2024 18:09
@tamaroning
Copy link
Contributor Author

Can someone rerun CI?

@beeme1mr beeme1mr changed the title reexport async_trait::async_trait fix: reexport async_trait::async_trait Apr 24, 2024
@tamaroning
Copy link
Contributor Author

Oh thank you. It complained about the title of this pr.

@beeme1mr
Copy link
Member

Oh thank you. It complained about the title of this pr.

It should be fixed now.

@beeme1mr beeme1mr requested a review from justinabrahms April 24, 2024 18:26
@sheepduke
Copy link
Contributor

Just one question: is it required to export that?

I mean, is it technically required, or does it lead to a better design?
(I thought the user could directly import async_trait to achieve this, but it might be ugly...)

@tamaroning
Copy link
Contributor Author

tamaroning commented Apr 26, 2024

I tried to impl FeatureProvider without #[async_trait] but couldn't because this macro seems to generate complex lifetime annotations so using the async_trait macro is probabley required.
If this library does not export the macro, users have to import async_trait on their own and make sure that its version matches with this repo. (it will be ugly)

Async-rust, a famous graphql implementation in Rust, for example, export async_trait in this line.

@sheepduke sheepduke merged commit 40f911e into open-feature:main Apr 27, 2024
4 of 5 checks passed
@sheepduke
Copy link
Contributor

sheepduke commented Apr 27, 2024

I tried to impl FeatureProvider without #[async_trait] but couldn't because this macro seems to generate complex lifetime annotations so using the async_trait macro is probabley required. If this library does not export the macro, users have to import async_trait on their own and make sure that its version matches with this repo. (it will be ugly)

Async-rust, a famous graphql implementation in Rust, for example, export async_trait in this line.

Thanks for educating me! Now I totally understand it.

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.

3 participants