~irimi1/learning-rust

c5ee2198d69c1c05d641b957c325bada6e7c8a5b — Manuel Groß 2 years ago b663e1a
minigrep: Make use of the search function
1 files changed, 4 insertions(+), 0 deletions(-)

M projects/minigrep/src/lib.rs
M projects/minigrep/src/lib.rs => projects/minigrep/src/lib.rs +4 -0
@@ 4,6 4,10 @@ use std::fs;
pub fn run(config: Config) -> Result<(), Box<dyn Error>> {
    let contents = fs::read_to_string(config.filename)?;

    for line in search(&config.query, &contents) {
        println!("{}", line);
    }

    Ok(())
}