DEV Community

Discussion on: Higher-Order Functions in Rust

Collapse
 
deciduously profile image
Ben Lovy

I've implemented pure versions of map_rows, map_rows2, and make_incrementer - here's an updated Playground link.

The signatures are almost the same - I've just replaced &mut Grid with &[Vec<i32>]. The only difference is the body of the functions themselves but you're correct - this set adheres more strictly to a functional paradigm whereas the originals do not.