~irimi1/learning-rust

ba98aa67b66286e88514f14ab294e182175af154 — Manuel Groß 2 years ago 1465559
minigrep: Move logic to separate function
1 files changed, 4 insertions(+), 0 deletions(-)

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

    run(config);
}

fn run(config: Config) {
    let contents = fs::read_to_string(config.filename)
        .expect("Something went wrong reading the file");