I\'m trying to sort an array with a map() over an iterator.
map()
struct A { b: Vec, } #[derive(PartialEq, Eq, PartialOrd, Ord)] struct
As the book you linked to says:
If you are trying to execute a closure on an iterator for its side effects, use for instead.
for
That way it works, and it's much clearer to anyone reading the code. You should use map when you want to transform a vector to a different one.
map