Consider move() parameters with cloning

Every using with move, I've to use several clone()s and let = s for moving cursors into closure. I'm considering macros like clone_for_moving!(var1,var2,var3; |param| { // body block }); but I have to write long macro names every time.

It's my idea to use move(var1, var2, var3) || {} to explicitly specify variables as cloned into closure, and it seems like an unccupied syntax.

1 Like

Similar syntax is currently being discussed here:

In this proposal, the clones would be explicit, but still more concise than currently. It's unlikely that Rust will ever have fully implicit clones.

Search for "clone closure" to find some prior discussions.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.