7 ms·
Thank you! I ran into this branching problem the other day, ended up trying to return a complicated boxed future and gave up. In retrospect it makes sense to d
by scriptsmith 4y ago
Thank you! I ran into this branching problem the other day, ended up trying to return a complicated boxed future and gave up.
In retrospect it makes sense to do it the way you mentioned. I think because I’m not as confident with traits and rust’s brand of async I tried to get it to work the same way I would in other languages, which is to mess with the function’s return type myself, rather than let the compiler figure it out.
- Winsaucerer 4y agoYep, it's a good tip, something I'd been hitting too!