The most common HOFs

Higher-order functions are common in Rust in two different fields of application:

  • Iterators
  • Options

Knowing the most common of these functions and how to use them can give our code a performance boost.

Helpful tips for the rest of the course

  1. Play with the code. The more you play, the more you will understand HOF and by extension FP.
  2. Keep this lesson open while you’re going through the rest of the course. These core concepts will be helpful all the way to the end.
  3. The list below not only contains HOFs, but also some other useful methods for dealing with iterators, options, and results.
  4. Most Result have some HOFs. However, if you know the HOFs present in Option, then you already know most of the HOFs relevant to Result. Rust’s official documentation has all the details.

Get hands-on with 1400+ tech skills courses.