- There's no need for the temporary variable, can just return directly
- The `vec` argument should be a `&[T]` not a `&Vec<T>` [discouraged]
- The `func` argument shouldn't be a function pointer but instead take an unboxed, generic closure (no forced pointer indirection, can take a closure). You may even want to accept a `FnMut` to allow the closure to mutate itself.
- The `vec` argument should be a `&[T]` not a `&Vec<T>` [discouraged]
- The `func` argument shouldn't be a function pointer but instead take an unboxed, generic closure (no forced pointer indirection, can take a closure). You may even want to accept a `FnMut` to allow the closure to mutate itself.
[discouraged]: https://stackoverflow.com/q/40006219/155423