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)
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)