prefer-clone-from Prefer Clone.cloneFrom when replacing a cloneable value Assigning a newly cloned value discards storage that the destination may be able to reuse. Instead, you SHOULD call cloneFrom so the destination can reuse its existing allocation. - Category: performance - Level: warning - Fix: suggestion - Scope: module Reported import { rc } from "destack:memory"; function replace(target: &exclusive rc.Rc, source: &readonly rc.Rc): void { *target = source.clone(); } Accepted import { rc } from "destack:memory"; function replace(target: &exclusive rc.Rc, source: &readonly rc.Rc): void { target.cloneFrom(source); } Prior art - Clippy ยท assigningclones language/linter/src/rules/performance/preferclonefrom.rs:8