Rust avoids memory copies by optimizing return value placement.