Jenztsch

joined 1 year ago
[–] [email protected] 2 points 10 months ago (3 children)

I'm not sure how you intend to use this. When no variables are captured, the borrow checker will not have any issues with the closure method.

When you are still capturing, you could implement a macro like one answer suggests. However, IMO this highly depends on the complexity of the duplicated code and even then I don't immediately see what the benefits compared to extracting it as a closure/function are.

[–] [email protected] 6 points 10 months ago* (last edited 10 months ago) (7 children)

This is entering subjective taste, but in my opinion this also is a feature of Rust. Especially when the closures are more complicated, it may be not as obvious if and where they are changing state (the fact that Rust implicitely mutably borrows the variables to the closures doesn't help either).

So a solution of this issue for me would be to add the changed variables as parameters to the closures and explicitely mutably borrow them at the calls in the loop: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=78cc7947e2e0b07b54baf6e1a75a2632

I would agree with you that this increases code verbosity. However, this would be a price I'm willing to pay to help understand at quicker glances what happens inside this loop.

[–] [email protected] 2 points 11 months ago* (last edited 11 months ago)

This seems like the most likely case. I could have sworn that I saw mentions to Arena elsewhere a few days ago, but now I can't find anything else than this wiki page.

And as far as I understand all previous starter kits did have such codes (this is my first one, so I can't speak from experience 😅), so a copy-paste error makes sense.

[–] [email protected] 9 points 1 year ago* (last edited 1 year ago)

It is most likely a reference to Abigail from the game Stardew Valley. You can gift her items and, initially due to a programming quirk which was then kept as an ascended meme, she treats all her favorites as food and exclaims to eat them. This includes gemstones like amethysts.

[–] [email protected] 12 points 1 year ago* (last edited 1 year ago)

Ich glaube, hier wäre im Zitat der Satz davor noch wichtig gewesen:

In Zukunft sollen aber Spenden eingeworben werden;

Die non-profit ruht dem Artikel und eigenen Angaben nach nicht aus dieser Umstellung her. Es wurden sogar seit 2021 keine Spendenquittungen mehr ausgestellt. Eher will sich generell für die US-Geldbeutel attraktiver machen.

Einen Zusammenhang zwischen den beiden sehe ich aus den aktuellen Informationen zumindest nicht.

view more: ‹ prev next ›