DEV Community

Discussion on: Higher-Order Functions in Rust

Collapse
 
deciduously profile image
Ben Lovy • Edited

Way better! I was specifically trying to avoid map but you're definitely right about using vec! and passing by value for this function.

Using the trait object in the parameter list is better for the local closure version too.