Earlier quoted context omitted.
I am not a Rust user and maybe I am reading the post wrong but it seems that syntax has been deprecated: > Closures: Rust now supports full capture-clause inference and has deprecated the temporary |:| notation, making closures much more ergonomic to use.
What was deprecated is the explicit closure type specification, which is only the ":" part.
|args| expr // upvars captured by reference, can't be called after function has gone out of scope
move |args| expr // upvars moved from function to the closure context (or copied if trivially copyable)
This is simple and good enough for most use cases. If you want more complex schemes, you have to implement them manually, e.g. to reference count the upvars, like Apple blocks do by default, wrap them in Rc and capture that.Accepting closures is a bit more complicated though.