Skip to content

fix(async): flatten timeout result

Georgy Moshkin requested to merge fix/flatten-timeout-error into master

Used to be that timeout would resolve into one of these cases:

  • Ok(Ok(v))
  • Ok(Err(e))
  • Err(Expired)

Now the cases are:

  • Ok(v)
  • Err(Error::Failed(e))
  • Err(Error::Expired)

As a side effect only futures that resolve into std::result::Result<T, E> can be wrapped with a Timeout future, which is the majority of cases.

Merge request reports