change -k to default _

This commit is contained in:
rustdesk 2024-05-24 17:57:37 +08:00
parent 4240c47244
commit c4c26dd6d7
2 changed files with 2 additions and 2 deletions

View File

@ -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(())
}

View File

@ -31,6 +31,6 @@ fn main() -> ResultType<()> {
}
let rmem = get_arg("rmem").parse::<usize>().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(())
}