From 9fa72cc5a50d225482fccf35ff999025e4e21856 Mon Sep 17 00:00:00 2001 From: zephyr Date: Mon, 11 Apr 2022 12:30:34 +0900 Subject: [PATCH] omg! local and remote parsed from cmd args should not be reversed --- cmd/src/server.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cmd/src/server.rs b/cmd/src/server.rs index 36f55e8..cae7e31 100644 --- a/cmd/src/server.rs +++ b/cmd/src/server.rs @@ -13,13 +13,9 @@ use kaminari_cmd::{Endpoint, parse_cmd, parse_env}; #[tokio::main] async fn main() -> Result<()> { - let ( - Endpoint { - local: remote, - remote: local, - }, - options, - ) = parse_env().or_else(|_| parse_cmd())?; + let (Endpoint { local, remote }, options) = parse_env() + .map(|(Endpoint { local, remote }, opt)| (Endpoint { remote, local }, opt)) + .or_else(|_| parse_cmd())?; let ws = opt::get_ws_conf(&options); let tls = opt::get_tls_server_conf(&options);