Practice
Learn
← Quit
0 / 0 correct
Rust
Hard
1 of 40
Heterogeneous collection: Vec<Box<dyn Shape>> vs Vec<ShapeEnum>. Which is accurate?
A
The enum avoids heap allocations and dynamic dispatch, but is closed to new variants; trait objects are open but slower
B
Enums can't hold data
C
Trait objects are always faster
D
They have identical performance