Enter your book access code

The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).

Don’t have the book yet? The landing page stays open — purchase unlocks this gym.

beginner · order 20

Return ownership, not a borrow of a local

own-fn-02Related book chapters: 5 (optional — this page is complete on its own)ownershipreturn

Slug: own-fn-02 · Paired reading: Chapter 5

Prompt

fn make_greeting(name: &str) -> String — build "Hello, {name}" and return an owned String. Returning &str to a local buffer would dangle.