Replace Arc::clone(foo) with foo.clone()
This pattern was required by clippy::clone_on_ref_ptr
.
But that lint is no longer enabled, since !352 (merged).
Remove it, because:
-
It gets in the way of refactoring. If, in
Arc::clone(&t)
, theArc
is moved insidet
's type,t.clone()
still works, but obviouslyArc::clone()
doesn't. -
It is longer to type, and more awkward and IMO harder to read
I made this change by:
git-grep -l Arc::clone | xargs perl -i~ -pe 's/Arc::clone\(\&?([^()]+)\)/$1.clone()/g'
and then undoing the two adjacent call sites in arti-bench where type
inference required Arc::clone
to be explicitly specified.