Lemmy Coupou.fr
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Ephera@lemmy.ml to Rust Programming@lemmy.mlEnglish · 1 year ago

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

lemmy.ml

message-square
7
link
fedilink
50

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 · 1 year ago
message-square
7
link
fedilink
  • SWW13@lemmy.brief.guru
    link
    fedilink
    arrow-up
    12
    ·
    1 year 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
      9
      ·
      1 year 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
Visibility: Public
globe

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

  • 1 user / day
  • 45 users / week
  • 62 users / month
  • 398 users / 6 months
  • 1 local subscriber
  • 9.18K subscribers
  • 509 Posts
  • 1.35K Comments
  • Modlog
  • mods:
  • Nutomic@lemmy.ml
  • Joe@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • BE: 0.19.16
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org