-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Convert Callback to be an enum to support Fn and FnOnce. #1125
Conversation
1473dc3
to
cf68fa7
Compare
@jstarry Thanks for your advice. I had tripped wrapping the callaback in an Option, but without the RefCell I obviously couldn't get it to work. One resulting issue now is the build is failing due to clippy warning about the complexity of the type:
I thought I'd solicit some input on how you'd break this up, since it's mostly about what to name the type, and how much of the type to extract. I was thinking something like:
|
Nice work! How about this: type CallbackOnce<IN> = RefCell<Option<Box<dyn FnOnce(IN)>>>; Also can you please add this function: ( |
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.
Just one small thing. Btw really appreciate the comment cleanup and your attention to detail!
Thanks, I agree |
Closes #1039