Ignore empty ZED_IMPERSONATE env var

This commit is contained in:
Max Brunsfeld 2021-09-21 13:29:06 -07:00
parent 412535420b
commit 9352c4e076

View file

@ -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<String> = std::env::var("ZED_IMPERSONATE").ok();
static ref IMPERSONATE_LOGIN: Option<String> = std::env::var("ZED_IMPERSONATE")
.ok()
.and_then(|s| if s.is_empty() { None } else { Some(s) });
}
pub struct Client {