Ephera@lemmy.ml to Rust Programming@lemmy.mlEnglish · 4 months agoWhen I have an Option<Result<T, E>> but need a Result<Option<T>, E>lemmy.mlimagemessage-square4fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageWhen I have an Option<Result<T, E>> but need a Result<Option<T>, E>lemmy.mlEphera@lemmy.ml to Rust Programming@lemmy.mlEnglish · 4 months agomessage-square4fedilink
minus-squareSWW13@lemmy.brief.gurulinkfedilinkarrow-up0·4 months agoYou can use transpose() to go from Option<Result<T>> to Result<Option<T>> and vice versa. The “meme” is a trans pride flag and a human pose.
You can use
transpose()
to go fromOption<Result<T>>
toResult<Option<T>>
and vice versa.The “meme” is a trans pride flag and a human pose.