miniblog.

← Back to all posts
31
Today I learnt about clippy::clone_on_ref_ptr, which complains about t.clone() on a Rc<Thing>. You write Rc::clone(t) instead, so it's obvious it's a cheap clone. It's a nice approach, because it makes the expensive clones more obvious.

1 Comment

@wilfredh @Mara if you ever release an updated version of your atomics and locks book, it would be great if you could use that convention in the code example in https://mara.nl/atomics/basics.html#naming-clones