This Week in Rust 631 (this-week-in-rust.org)
submitted 10 months ago by to c/rust@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[–] 1 point 10 months ago* (last edited 10 months 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

  • source