Rust's “copy on write” Cow abstraction is very useful to avoid costly cloning when dealing with vectors or strings. A Cow allows you to defer allocating new memory until it becomes inevitable. Consider the following example: use std::borrow::Cow; fn do_something_or_nothing(v: Cow<str>) -> Cow<str> { if v.len() > 3 { let s = "Hello ".to_string() + &*v; Cow::Owned(s) } else { v } } Only if the input