Slug: own-move-05 · Paired reading: Chapter 5
Prompt
fn append_then_len(mut v: Vec<i32>, x: i32) -> (Vec<i32>, usize) —
push x, return the vec and its length. The caller must receive
ownership back; they cannot use a moved-away v.
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 7
Slug: own-move-05 · Paired reading: Chapter 5
fn append_then_len(mut v: Vec<i32>, x: i32) -> (Vec<i32>, usize) —
push x, return the vec and its length. The caller must receive
ownership back; they cannot use a moved-away v.