Add logic for reading files

This commit is contained in:
Manuel Thalmann 2025-03-04 23:23:23 +01:00
parent ab76644498
commit c65f7203a1

View file

@ -1,4 +1,5 @@
use std::env;
use std::fs;
fn main() {
let args: Vec<String> = env::args().collect();
@ -8,4 +9,9 @@ fn main() {
println!("Searching for {query}");
println!("In file {file_path}");
let contents = fs::read_to_string(file_path)
.expect("Should have been able to read the file");
println!("With text:\n{contents}");
}