fstab
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Ephera@lemmy.ml 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
fedilink
47

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 · 4 months ago
message-square
7
fedilink
  • SWW13@lemmy.brief.guru
    link
    fedilink
    arrow-up
    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
      arrow-up
      8
      ·
      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
Visibility: Public
globe

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

  • 1 user / day
  • 3 users / week
  • 132 users / month
  • 589 users / 6 months
  • 1 local subscriber
  • 8.86K subscribers
  • 240 Posts
  • 731 Comments
  • Modlog
  • mods:
  • Nutomic@lemmy.ml
  • Joe@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org