Hacker News new | ask | show | jobs
by scriptsmith 1402 days 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.

1 comments

Yep, it's a good tip, something I'd been hitting too!