gtk-rs / gtk-rs-core

Rust bindings for GNOME libraries
https://gtk-rs.org/gtk-rs-core
MIT License
272 stars 103 forks source link

glib-macros: Don't produce unnecessary braces in `clone!(async move {… #1443

Closed sdroege closed 2 weeks ago

sdroege commented 2 weeks ago

… x })`

This would wrongly suggest to remove the braces, which is invalid syntax, because the macro already adds another layer of braces around the body of the async block.

To avoid this, don't output the braces of the async block in the macro expansion and instead only use the braces added by the macro.

sdroege commented 2 weeks ago

This also affects the old macro but I can't be bothered to fix it there