Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
RoundSparrow ( RoundSparrow@lemmy.ml ) Banned to Rust Programming@lemmy.ml · 3 年前

Lemmy Server's (lemmy_server) Rust code, stuck on use of return and how the general Ok / error return works

message-square
message-square
9
link
fedilink
10
message-square

Lemmy Server's (lemmy_server) Rust code, stuck on use of return and how the general Ok / error return works

RoundSparrow ( RoundSparrow@lemmy.ml ) Banned to Rust Programming@lemmy.ml · 3 年前
message-square
9
link
fedilink

I haven’t had this much trouble since Ada coding in 1986 when I was age 16.

Can someone please help me get the procedural syntax right?

https://github.com/LemmyNet/lemmy/pull/3805

  • TehPers ( TehPers@beehaw.org ) 
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 年前

    Looks like labels don’t work on async blocks, but using a nested inner block does work. Also, yeah, async blocks only exist to create Futures, they don’t execute until you start polling them. I don’t really see any reason why you couldn’t stick a label on the async block itself though, breaking would at worst just create one new state for the future - early returned.

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
  • 2 users / week
  • 33 users / month
  • 121 users / 6 months
  • 219 local subscribers
  • 9.4K subscribers
  • 323 Posts
  • 808 Comments
  • Modlog
  • mods:
  • Nutomic ( nutomic@lemmy.ml ) 
  • Joe ( Joe@lemmy.ml ) 
  • AgreeableLandscape ( AgreeableLandscape@lemmy.ml ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code