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 8

into_iter empties the collection

own-move-06Related book chapters: 5, 9 (optional — this page is complete on its own)ownershipinto-iter

Slug: own-move-06 · Paired reading: Chapters 5 and 9

Prompt

fn sum_consuming(v: Vec<i32>) -> i32 — sum via into_iter (moves elements out). Contrast: borrowing with iter would leave v usable; consuming does not.