Lemmy.one
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Ephera@lemmy.ml to Rust Programming@lemmy.mlEnglish · 6 个月前

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

lemmy.ml

message-square
7
fedilink
52

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 · 6 个月前
message-square
7
fedilink
  • SWW13@lemmy.brief.guru
    link
    fedilink
    arrow-up
    11
    ·
    6 个月前

    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
      ·
      6 个月前

      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
  • 1 user / week
  • 44 users / month
  • 467 users / 6 months
  • 82 local subscribers
  • 8.93K subscribers
  • 300 Posts
  • 985 Comments
  • Modlog
  • mods:
  • Nutomic@lemmy.ml
  • Joe@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • BE: 0.19.7
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org