programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RoundSparrow@lemmy.mlBanned to Rust Programming@lemmy.ml ·
edit-2
2 years ago

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@lemmy.mlBanned to Rust Programming@lemmy.ml ·
edit-2
2 years ago
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

  • nous
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    2 years ago

    Looks to be failing a cargo fmt check: https://woodpecker.join-lemmy.org/repos/129/pipeline/1821/8

    + cargo +nightly-2023-07-10 fmt -- --check
    Diff in /woodpecker/src/github.com/LemmyNet/lemmy/crates/utils/src/rate_limit/mod.rs at line 224:
     use std::sync::atomic::{AtomicUsize, Ordering};
     static CONCURRENT_API_USE: AtomicUsize = AtomicUsize::new(0);
     
    -
     impl<s> Service for RateLimitedMiddleware<s>
     where
       S: Service + 'static,
    

    If I read that right you have one extra blank new line that the nightly rust fmt is not happy about.

    You should just need to run cargo fmt on the code, might need the same nightly version as above though.</s></s>

    • RoundSparrow@lemmy.mlBannedOP
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      Thank you, removed the whitespace for another run: https://github.com/LemmyNet/lemmy/pull/3805/commits/33cc3967452d6b4a0369e4f85b17ff121c89451d

      • nous
        link
        fedilink
        English
        arrow-up
        6
        ·
        2 years ago

        Looks like it is now failing on the SQL fmt checks - which you have not changed and so are likely a problem in master. Seems https://github.com/LemmyNet/lemmy/pull/3800 fixes that issue and you are likely going to need to wait for that to be merged first. Or otherwise talk to the maintainers about it since it is broken in master and there is aPR to fix the issue.

        • RoundSparrow@lemmy.mlBannedOP
          link
          fedilink
          arrow-up
          3
          ·
          2 years ago

          Thank you!

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.

  • 8 users / day
  • 12 users / week
  • 45 users / month
  • 610 users / 6 months
  • 268 local subscribers
  • 8.74K subscribers
  • 289 Posts
  • 953 Comments
  • Modlog
  • mods:
  • Nutomic@lemmy.ml
  • Joe@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org