21
This Week in Rust 631 (this-week-in-rust.org)
submitted 1 week ago by mrbn@lemmy.ca to c/rust@programming.dev
top 1 comments
sorted by: hot top controversial new old
[-] HoloPengin@lemmy.world 1 points 4 days ago* (last edited 4 days ago)

NGL that block pattern thing is something I never really noticed but it makes a lot of sense. The messy way to do it in C++ would be with a lambda that you then just evaluate, but being about to avoid that and instead using standard scoping syntax for the same thing neat. I'm pretty sure I've even done this before without even thinking about it.

And if you put all of the definitions you need right at the top it's super easy to split out into a function if/when you need it elsewhere

this post was submitted on 25 Dec 2025
21 points (95.7% liked)

Rust

7626 readers
70 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS