Run the logic for the minigrep command

This commit is contained in:
Manuel Thalmann 2025-03-20 23:20:02 +01:00
parent e9e4c403e6
commit c27907555d
Signed by: manuth
SSH key fingerprint: SHA256:HsMLC+7kJWALP6YCYCoopxNbUnghwSGLVcG76SECT5c

View file

@ -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(())
}