From 0f927fa6fbea51ad55eea63b455b7957ab409dc9 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 29 May 2024 23:44:56 +0300 Subject: [PATCH] One less unwrap (#12448) Fixes https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1717011343884699 Release Notes: - N/A --- crates/project/src/terminals.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/project/src/terminals.rs b/crates/project/src/terminals.rs index b68775ec9c..15f130b03f 100644 --- a/crates/project/src/terminals.rs +++ b/crates/project/src/terminals.rs @@ -89,8 +89,10 @@ impl Project { path, }); - let is_terminal = spawn_task.is_none() && (working_directory.as_ref().is_none()) - || (working_directory.as_ref().unwrap().is_local()); + let is_terminal = spawn_task.is_none() + && working_directory + .as_ref() + .map_or(true, |work_dir| work_dir.is_local()); let settings = TerminalSettings::get(settings_location, cx); let python_settings = settings.detect_venv.clone(); let (completion_tx, completion_rx) = bounded(1);