Convert Callback to be an enum to support Fn and FnOnce.#1125
Convert Callback to be an enum to support Fn and FnOnce.#1125jstarry merged 8 commits intoyewstack:masterfrom
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: ( |
jstarry
left a comment
There was a problem hiding this comment.
Just one small thing. Btw really appreciate the comment cleanup and your attention to detail!
|
Thanks, I agree |
Closes #1039