~irimi1/learning-rust

ref: c5ee2198d69c1c05d641b957c325bada6e7c8a5b learning-rust/projects/minigrep/src/main.rs -rw-r--r-- 394 bytes
c5ee2198Manuel Groß minigrep: Make use of the search function 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::env;
use std::process;

use minigrep::Config;

fn main() {
    let args: Vec<String> = env::args().collect();

    let config = Config::new(&args).unwrap_or_else(|err| {
        println!("Problem parsing arguments: {}", err);
        process::exit(1);
    });

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