From fd69ced633e7854606f7005297fe9bde83c5d355 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:49:11 +0200 Subject: [PATCH] fix: remove unwrap --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2042a60..84dd1bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,7 +75,11 @@ fn run() -> anyhow::Result<()> { break 'finder project_root; } - project_root = project_root.parent().unwrap().to_path_buf(); + if let Some(parent) = project_root.parent() { + project_root = parent.to_path_buf(); + } else { + break; + } } cwd.clone()