From 9352c4e0760c71e8613c32ec14fee399fdaab454 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 21 Sep 2021 13:29:06 -0700 Subject: [PATCH] Ignore empty ZED_IMPERSONATE env var --- zed/src/rpc.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zed/src/rpc.rs b/zed/src/rpc.rs index 6ae83354e0..5dc2b49b76 100644 --- a/zed/src/rpc.rs +++ b/zed/src/rpc.rs @@ -30,7 +30,9 @@ use zrpc::{ lazy_static! { static ref ZED_SERVER_URL: String = std::env::var("ZED_SERVER_URL").unwrap_or("https://zed.dev:443".to_string()); - static ref IMPERSONATE_LOGIN: Option = std::env::var("ZED_IMPERSONATE").ok(); + static ref IMPERSONATE_LOGIN: Option = std::env::var("ZED_IMPERSONATE") + .ok() + .and_then(|s| if s.is_empty() { None } else { Some(s) }); } pub struct Client {