let x = Arc::new(foo);
let x_1 = x.clone();
tokio::spawn(async move {
// something involving `x_1`
});
bar(x).await;
I often have a litany of such clones and I have taken to calling them x_1, x_2, etc. depending on how many closures whose appetite for clones I need to satisfy.
At the risk of inviting a bikeshedding, are there good general techniques for avoiding this cruft, and if not, is there a convention for naming and using these extra identifiers?