Slug: trait-impl-01 · Paired reading: Chapter 10
Prompt
fn odds(nums: &[i32]) -> impl Iterator<Item = i32> + '_ — iterate
odd values as owned i32s. impl Trait in return position hides the
concrete iterator type from the caller.
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.
intermediate · order 58
Slug: trait-impl-01 · Paired reading: Chapter 10
fn odds(nums: &[i32]) -> impl Iterator<Item = i32> + '_ — iterate
odd values as owned i32s. impl Trait in return position hides the
concrete iterator type from the caller.