Skip to content

Commit

Permalink
extracted logic to seperate function called run
Browse files Browse the repository at this point in the history
  • Loading branch information
dhanushrajgp committed Jul 6, 2024
1 parent 08aae98 commit 091679f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ fn main() {
println!("Searching for {}", config.query);
println!("In file {}", config.file_path);

run(config);
}

fn run(config: Config) {
let content =
fs::read_to_string(config.file_path).expect("should have been able to read the file");
println!("Content:\n {}", content);
Expand Down

0 comments on commit 091679f

Please sign in to comment.