~irimi1/learning-rust

55f2f50bee1b7e2ab1c8ada879e7776b8e29654f — Manuel Groß 2 years ago 41510e6
minigrep: Handle result that run() returns
1 files changed, 4 insertions(+), 1 deletions(-)

M projects/minigrep/src/main.rs
M projects/minigrep/src/main.rs => projects/minigrep/src/main.rs +4 -1
@@ 14,7 14,10 @@ fn main() {
    println!("Searching for {}", config.query);
    println!("In file {}", config.filename);

    run(config);
    if let Err(e) = run(config) {
        println!("Application error: {}", e);
        process::exit(1);
    }
}

fn run(config: Config) -> Result<(), Box<dyn Error>> {