Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unidiomatic use of feature flags #41

Closed
rklaehn opened this issue Jan 22, 2024 · 1 comment
Closed

Unidiomatic use of feature flags #41

rklaehn opened this issue Jan 22, 2024 · 1 comment
Labels
v2 Features or breaking API changes to be shipped as v2.0.0

Comments

@rklaehn
Copy link
Contributor

rklaehn commented Jan 22, 2024

Currently, the API changes depending on whether the async feature is enabled or not. E.g. the resolve function is async when the async feature is enabled, sync otherwise.

This can lead to trouble due to the way the rust feature flag system works. Features are supposed to be additive, so adding async should only add new methods and not change the signature of existing methods.

Even if it is ugly, it would be more correct to either prepend _async to the fns or have an entire async module that gets enabled due to the feature flag.

This would require increasing the major version number though, so maybe best combine it with other API changes.

@Nuhvi Nuhvi added the v2 Features or breaking API changes to be shipped as v2.0.0 label Feb 6, 2024
@Nuhvi
Copy link
Collaborator

Nuhvi commented May 4, 2024

Version 2 is using 3 features dht, async and relay each corresponds to a separate client. I think that should fix feature flags, but I would love if you check before I close this issue.

@Nuhvi Nuhvi mentioned this issue May 6, 2024
Merged
@Nuhvi Nuhvi closed this as completed May 7, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
v2 Features or breaking API changes to be shipped as v2.0.0
Projects
None yet
Development

No branches or pull requests

2 participants