From a663f2b4d8f85eb957a576d2fdaba5e37cf04936 Mon Sep 17 00:00:00 2001 From: Ian Rettig Date: Fri, 6 Jun 2025 14:46:21 -0400 Subject: [PATCH] Feat: set up manual error handling. --- src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.rs b/src/main.rs index 686c351..b54b991 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,16 @@ fn main() { let content = std::fs::read_to_string(&args.path).expect("Could not read file."); + let result = std::fs::read_to_string("test.txt"); + match result { + Ok(content) => { + println!("File content: {}", content); + } + Err(error) => { + println!("Oh no error: {}", error); + } + } + for line in content.lines() { if line.contains(&args.pattern) { println!("{}", line)