Now, later, or only in tests
— part 8 of Rust Beyond Systems Programming
Three ways to hand code around — a block that runs now, a closure that runs later, a function with a name — and how to choose. Tests that become a table. And conditional compilation: code decided before the program runs, and why that is safer than deciding it while it runs.