Ephera to Rust [email protected]English • 2 days agoWhen I have an Option<Result<T, E>> but need a Result<Option<T>, E>lemmy.mlimagemessage-square7fedilinkarrow-up151arrow-down14
arrow-up147arrow-down1imageWhen I have an Option<Result<T, E>> but need a Result<Option<T>, E>lemmy.mlEphera to Rust [email protected]English • 2 days agomessage-square7fedilink
minus-square@[email protected]linkfedilink7•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.