From 2e7bfcbfc6a1792bebf14205e6e3e93a6d5c8afa Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sat, 7 Jan 2023 15:46:03 +0100 Subject: [PATCH] update: config build refactor --- src/config.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/config.rs b/src/config.rs index b516ced..c351594 100644 --- a/src/config.rs +++ b/src/config.rs @@ -50,12 +50,11 @@ pub struct Flags { impl Context { pub async fn new<'a>() -> Self { - let argp = Context::argparse(); // Get flags - let debug: bool = argp.contains_id("debug"); + let argp: ArgMatches = Context::argparse(); + //let debug: bool = argp.contains_id("debug"); + let debug: bool = argp.get_one::("debug").unwrap().to_owned(); let server: String = argp.get_one::("server").unwrap().to_string(); - //.unwrap_or(format!("https://{}", MASTERSERVER).as_str()) - //.to_string(); // Build context let mut ctx = Context {