From 4a94cea7fbba99a78ce9fb07820d93c5a3c7351e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 4 Mar 2025 08:51:13 +0100 Subject: [PATCH] Save command line args in variables --- minigrep/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/minigrep/src/main.rs b/minigrep/src/main.rs index ae7def5..afc3c3c 100644 --- a/minigrep/src/main.rs +++ b/minigrep/src/main.rs @@ -2,5 +2,10 @@ use std::env; fn main() { let args: Vec = env::args().collect(); - dbg!(args); + + let query = &args[1]; + let file_path = &args[2]; + + println!("Searching for {query}"); + println!("In file {file_path}"); }