Rust 1.40.0
73528e339

# Closures

There is a new edition of the book and this is an old link.

> Anonymous functions you can save in a variable or pass as arguments to other functions.

    let expensive_closure = |num| {
        println!("calculating slowly...");
        thread::sleep(Duration::from_secs(2));
        num
    };Run

Here are the relevant sections in the new and old books:

- in the current edition: Ch 13.01 — Closures
- In the first edition: Ch 3.23 — Closures