Ephera@lemmy.ml to Rust Programming@lemmy.mlEnglish · 2 days agoWhen I have an Option<Result<T, E>> but need a Result<Option<T>, E>lemmy.mlimagemessage-square7fedilinkarrow-up150arrow-down14
arrow-up146arrow-down1imageWhen I have an Option<Result<T, E>> but need a Result<Option<T>, E>lemmy.mlEphera@lemmy.ml to Rust Programming@lemmy.mlEnglish · 2 days agomessage-square7fedilink
minus-squareSWW13@lemmy.brief.gurulinkfedilinkarrow-up7·1 day 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.
Ah, so a trans pose.
Nice.