Open xamgore opened 6 months ago
I'd like to run FuturesOrdered::from_iter(...) and retrieve the result of the last element, which is Option<...>. The same function exists in std.
FuturesOrdered::from_iter(...)
Option<...>
It can be implemented with
iter.fold(None, |_acc, x| async move { Some(x) })
But try_last would require extra checks: if there is an intermediate error, return it. If not, return the last successful Ok(...).
try_last
Ok(...)
I'd like to run
FuturesOrdered::from_iter(...)
and retrieve the result of the last element, which isOption<...>
. The same function exists in std.It can be implemented with
But
try_last
would require extra checks: if there is an intermediate error, return it. If not, return the last successfulOk(...)
.