Tim's Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Ephera@lemmy.ml to Rust Programming@lemmy.mlEnglish · 2 months ago

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

lemmy.ml

external-link
message-square
7
fedilink
1
external-link

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

lemmy.ml

Ephera@lemmy.ml to Rust Programming@lemmy.mlEnglish · 2 months ago
message-square
7
fedilink
  • SWW13@lemmy.brief.guru
    link
    fedilink
    arrow-up
    0
    ·
    2 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
      arrow-up
      0
      ·
      2 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: [email protected]
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 2 users / week
  • 3 users / month
  • 103 users / 6 months
  • 0 local subscribers
  • 8.73K subscribers
  • 146 Posts
  • 356 Comments
  • Modlog
  • mods:
  • Nutomic@lemmy.ml
  • Joe@lemmy.ml
  • UI: unknown version
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org