From a33109f062176d971bbed09717d74bdb8733cf5a Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Wed, 29 Nov 2023 13:11:26 +0100 Subject: [PATCH] simplify error handling --- src/main.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2722978..0a468f8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,14 +3,8 @@ mod settings; use settings::Settings; fn main() { - let settings = Settings::new(); - let settings = match settings { - Ok(s) => s, - Err(_) => { - println!("Could not read settings. Please provide the settings file 'clrigctl.toml'."); - return; - } - }; + let settings = Settings::new() + .expect("Could not read settings."); println!("{:?}", settings); }