From fa7626b78a1e1ed152da83af518d7911e928bcf0 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Mon, 5 Aug 2024 16:09:59 +0400 Subject: [PATCH] fix(example): args parser --- examples/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/main.rs b/examples/main.rs index 82e8b28..81426ac 100644 --- a/examples/main.rs +++ b/examples/main.rs @@ -9,10 +9,11 @@ async fn main() -> Result<(), tokio_gemini::LibError> { let mut args = std::env::args(); let mut insecure = false; let mut url = "gemini://geminiprotocol.net/".to_owned(); - if let Some(arg) = args.nth(1) { + _ = args.next(); // skip exe path + if let Some(arg) = args.next() { if arg == "-k" { insecure = true; - if let Some(arg) = args.nth(2) { + if let Some(arg) = args.next() { url = arg; } } else {