Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

One less unwrap (#12448)

Kirill Bulatov0f927fa6fbea
diff --git a/crates/project/src/terminals.rs b/crates/project/src/terminals.rs
index b68775ec9c2..15f130b03fd 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);