-
Notifications
You must be signed in to change notification settings - Fork 7
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(simple): remove Default & 'static requirement with async-scoped feature #13
Conversation
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.
Thanks for putting out this PR @beckend 🙇
The code looks great, and I certainly learned about async-scoped
today!
One non-code thing -- would you mind using Conventional Commits for your commit message? Something like feat(simple): remove Default & 'static requirement with async-scoped feature
would probably represent this well (feel free to adjust that)
I personally copied the code as my own module, I also have 2 versions. This one and one with I did this PR as a suggestion, it's fully open to be modified by you before merge. |
Make your decision and I can adjust. Personally I think that static lifetime should not be required as demonstrated in the comments and tests. |
Thanks for implementing the changes -- going to take another look and figure out how to merge this work in -- thank you! |
Hey @beckend I figured out how I'm going to merge in these changes -- I've split up the fixes into separate PRs:
This makes them a bit easier for me to understand personally -- the only one I haven't implemented yet is the non-default bounds, should have that PR upfairly soon as well. I've put you as a co-author on all the commits, thank you again for the improvements! |
Closing out this PR since the changes that were in here have made it into 0.2.6: https://github.com/t3hmrman/async-dropper/releases/tag/async-dropper-simple-v0.2.6 |
#12
Default
is a breaking change if they relied on:AsyncDropper::default()
,Default::default()
,#[derive(Default)]
.It's a trade off where you can use any Struct without Default but lose the convenience with the above. If the user as a big struct, this crate becomes a hassle to use, with this change, they have to use
new
orwith_timeout
and not rely onDefault
and having no need to define it.'static
lifetime requirement is gone.inner()
,inner_mut()
,Deref
,DerefMut
available and tested.#[derive(Debug, PartialEq, Eq, Hash, Clone)]
IfT
allows, easier to store this struct in other structs.