pub trait SmartClone<T: ?Sized + ToOwned> {
// Required method
fn smart_clone(&self) -> Cow<'_, T>;
}
Expand description
Efficient clone reduction for hot paths
Required Methods§
Sourcefn smart_clone(&self) -> Cow<'_, T>
fn smart_clone(&self) -> Cow<'_, T>
Clone only if necessary, otherwise return reference