From f468ee11d77e833d642817c5240f7492a871e355 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Tue, 25 Apr 2023 14:34:20 -0700 Subject: [PATCH] cli: fix problem restarting tunnel with uppercase letter in name Fixes #180693 --- cli/src/tunnels/dev_tunnels.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cli/src/tunnels/dev_tunnels.rs b/cli/src/tunnels/dev_tunnels.rs index 010afbdb4338f..67a7a5e46e229 100644 --- a/cli/src/tunnels/dev_tunnels.rs +++ b/cli/src/tunnels/dev_tunnels.rs @@ -384,10 +384,11 @@ impl DevTunnels { ) -> Result { let (mut tunnel, persisted) = match self.launcher_tunnel.load() { Some(mut persisted) => { - let as_lowercase = persisted.name.to_ascii_lowercase(); - let preferred_name = preferred_name.unwrap_or(&as_lowercase); - if persisted.name != preferred_name { - (_, persisted) = self.update_tunnel_name(persisted, preferred_name).await?; + if let Some(preferred_name) = preferred_name.map(|n| n.to_ascii_lowercase()) { + if persisted.name.to_ascii_lowercase() != preferred_name { + (_, persisted) = + self.update_tunnel_name(persisted, &preferred_name).await?; + } } let (tunnel, persisted, _) = self