Practice
Learn
← Quit
0 / 0 correct
Rust
Hard
1 of 10
How do you write a function that returns either of two iterator types without boxing?
A
Return impl Iterator from both branches directly
B
It's impossible
C
Use an enum (e.g. either::Either) implementing Iterator, since impl Iterator must be one concrete type
D
Use generics on the return type chosen by the caller