StoicDeveloper
StoicDeveloper
I went ahead and wrote a library based on FuturesUnordered that does exactly this: https://github.com/StoicDeveloper/mapped_futures. I aim to publish it as a crate once I have some feedback.
Here is the crate that covers this issue: https://crates.io/crates/mapped_futures
> @StoicDeveloper what was the motivation for making a separate crate instead of opening a PR, here? @allsey87 Honestly, it had not occurred to me to do so. I haven't...
I'm having this same issue. The assist deletes about 30 lines of code inside the macro. Before using code action:  After using code action: 
I'm also considering further additions for more complex data structure support, such as: - MultiMapFutures which allows a key to index for one or more futures - BiMapFutures which allows...
> Thanks for the PR! It looks like a lot of the code added here is a copy from FutureUnordered. Is it possible to replace some of them with re-exports...
@taiki-e I've implemented a new module futures_keyed which contains most of the code that was in futures_unordered. futures_unordered and mapped_futures now consume the API of futures_keyed. There is more work...
@taiki-e I've addressed your comments and some merge conflicts resulting from work over the past few months. Let me know if there's anything else; I should be able to address...
Also, the crate I published evidently has unsound code that causes this bug in tokio: https://github.com/StoicDeveloper/mapped_futures/issues/4 That issue will obviously have to be resolved here before this PR can proceed....
I found unsoundness by running this PR's tests through miri. The unsoundness comes from the potential for a dropped task to still have a pointer in the ReadyToRunQueue, which will...