The following nl program demonstrates a simple version of the nl (number lines) utility in Rust. Because main returns an io::Result<()>, the ? operator can propagate I/O errors directly out of main.
This zip file contains the complete crate.