Slug: borrow-excl-03 · Paired reading: Chapters 6 and 9
Prompt
fn double_evens(v: &mut Vec<i32>) — double every even element in
place. You cannot push while iter() is live; mutate via indices or
iter_mut.
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 32
Slug: borrow-excl-03 · Paired reading: Chapters 6 and 9
fn double_evens(v: &mut Vec<i32>) — double every even element in
place. You cannot push while iter() is live; mutate via indices or
iter_mut.