Run the logic for the minigrep
command
This commit is contained in:
parent
e9e4c403e6
commit
c27907555d
1 changed files with 4 additions and 0 deletions
|
@ -21,6 +21,10 @@ impl Config {
|
|||
|
||||
pub fn run(config: Config) -> Result<(), Box<dyn Error>> {
|
||||
let contents = fs::read_to_string(config.file_path)?;
|
||||
for line in search(&config.query, &contents) {
|
||||
println!("{line}");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue