Why does StreamExt::filter
and StreamExt::filter_map
require functions that returns futures
#1987
Labels
Milestone
Currently looking at the api spec the functions for
StreamExt::filter
takes a function that must return a future, however in 99% of cases you just want to filter on the data, so why needlessly bloat the code withfuture::ready
, instead of having a dedicated function if this is really necessary (which i doubt).I can understand it being useful to have a function which takes futures, but
filter
andfilter_map
are very unexpected to require futures.It just feels like someone was a bit trigger happy on the merge button.
The text was updated successfully, but these errors were encountered: