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

std/tokio simple: timeout not working, it is actually None on Drop #12

Closed
beckend opened this issue Jan 28, 2024 · 4 comments
Closed

std/tokio simple: timeout not working, it is actually None on Drop #12

beckend opened this issue Jan 28, 2024 · 4 comments

Comments

@beckend
Copy link
Contributor

beckend commented Jan 28, 2024

https://github.com/t3hmrman/async-dropper/blob/main/crates/async-dropper-simple/src/lib.rs#L65

This line will replace self with Default impl and timeout becomes None: https://github.com/t3hmrman/async-dropper/blob/main/crates/async-dropper-simple/src/lib.rs#L61

Also as a note, adding Deref and Derefmut would be desirable to get the inner otherwise this Struct is less useful.

@beckend
Copy link
Contributor Author

beckend commented Jan 28, 2024

You can also remove the Default requirement easily by setting inner: Option<T> and manually set the inner to None when implementing Default for the Struct.

@t3hmrman
Copy link
Owner

Hey @beckend thank you so much for pointing this out -- would you be willing to put the changes into a PR?

I think the tests wouldn't even have to change -- just the code would be fine!

@beckend
Copy link
Contributor Author

beckend commented Jan 28, 2024

Sent the PR. Consider the breaking nature.

@t3hmrman
Copy link
Owner

t3hmrman commented Jan 31, 2024

Thanks to the work in the PR and comments, these improvements have all landed in version 0.2.6:

https://github.com/t3hmrman/async-dropper/releases/tag/async-dropper-simple-v0.2.6

Thanks!

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

No branches or pull requests

2 participants