Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

transposeOptionToResult

Transposes an Option of a Result into a Result of an Option.

  • Some(Ok(x)) -> Ok(Some(x))
  • Some(Err(e)) -> Err(e)
  • None => Ok(None)
function transposeOptionToResult<T, E>(input: Option<Result<T, E>>): Result<Option<T>, E>;
§
transposeOptionToResult<T, E>(input: Option<Result<T, E>>): Result<Option<T>, E>
[src]

§Type Parameters

§Parameters

§
input: Option<Result<T, E>>
[src]

§Return Type

§
Result<Option<T>, E>
[src]