Ephera to Rust Programming@lemmy.mlEnglish • 4 months agoWhen I have an Option<Result<T, E>> but need a Result<Option<T>, E>lemmy.mlimagemessage-square7arrow-up153
arrow-up153imageWhen I have an Option<Result<T, E>> but need a Result<Option<T>, E>lemmy.mlEphera to Rust Programming@lemmy.mlEnglish • 4 months agomessage-square7
minus-square@SWW13@lemmy.brief.gurulinkfedilink11•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.
Ah, so a trans pose.
Nice.