VA-11 Hall-A Bar
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Ephera to Rust Programming@lemmy.mlEnglish • 4 months ago

When I have an Option<Result<T, E>> but need a Result<Option<T>, E>

lemmy.ml

message-square
7
53

When I have an Option<Result<T, E>> but need a Result<Option<T>, E>

lemmy.ml

Ephera to Rust Programming@lemmy.mlEnglish • 4 months ago
message-square
7
  • @SWW13@lemmy.brief.guru
    link
    fedilink
    11•4 months ago

    You 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.

    • @howrar@lemmy.ca
      link
      fedilink
      7•4 months ago

      Ah, so a trans pose.

      Nice.

Rust Programming@lemmy.ml

!rust@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !rust@lemmy.ml
  • 1 user / day
  • 1 user / week
  • 125 users / month
  • 504 users / 6 months
  • 8.86K subscribers
  • 266 Posts
  • 772 Comments
  • Modlog
  • mods:
  • Nutomic
  • @Joe@lemmy.ml
  • @AgreeableLandscape@lemmy.ml
  • BE: 0.19.1
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org