flâneur — a map of the web's best reading

The Rust Programming Language

doc.rust-lang.org · 2,213 words · saved by 7 readers

The issue with the tuple code in Listing 4-5 is that we have to return the String to the calling function so we can still use the String after the call to calculate_length, because the String was moved into calculate_length.

References and Borrowing - The Rust Programming Language Keyboard shortcuts Press ← or → to navigate between chapters Press S or / to search in the book Press ? to show this help Press Esc to hide this help Auto Light Rust Coal Navy Ayu The Rust Programming Language References and Borrowing The issue with the tuple code in Listing 4-5 is that we have to return the String to the calling function so that we can still use the String after the call to calculate_length , because the String was moved into calculate_length . Instead, we can provide a reference to the String value. A reference is like

Explore this link on the map →

saved by

related reading