From c4c26dd6d76f00fccfab6e49d55293120d75750e Mon Sep 17 00:00:00 2001 From: rustdesk Date: Fri, 24 May 2024 17:57:37 +0800 Subject: [PATCH] change -k to default _ --- src/hbbr.rs | 2 +- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hbbr.rs b/src/hbbr.rs index 4c8a7849..49d449c2 100644 --- a/src/hbbr.rs +++ b/src/hbbr.rs @@ -39,7 +39,7 @@ fn main() -> ResultType<()> { matches.value_of("port").unwrap_or(&port.to_string()), matches .value_of("key") - .unwrap_or(&std::env::var("KEY").unwrap_or_default()), + .unwrap_or(&std::env::var("KEY").unwrap_or("-".to_owned())), )?; Ok(()) } diff --git a/src/main.rs b/src/main.rs index 36233ee3..902fc1ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,6 +31,6 @@ fn main() -> ResultType<()> { } let rmem = get_arg("rmem").parse::().unwrap_or(RMEM); let serial: i32 = get_arg("serial").parse().unwrap_or(0); - RendezvousServer::start(port, serial, &get_arg("key"), rmem)?; + RendezvousServer::start(port, serial, &get_arg_or("key", "-".to_owned()), rmem)?; Ok(()) }