Rust futures `try_filter_map` causing panic: ‘async fn resumed after completion’

It seems like this is a bug. Until a new release fixes the issue, it looks like you are using try_filter_map without actually filtering the stream? If that is the case, you can use and_then instead:

let s = stream::iter(vec![Ok(1), Ok(2), Ok(3)])
  .and_then(|v| future::ready(if v == 1 { Err("Ohno!") } else { Ok(v) }))
  .inspect_err(|err| println!("Error {:?}", err))
  .filter_map(|r| future::ready(r.ok()));

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top