fix(tazjin/emacs): don't crash in find-cargo-project

Change-Id: I8a94892a527958946c975047204000eaf15395f2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8946
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
This commit is contained in:
Vincent Ambo 2023-07-09 01:12:26 +03:00 committed by clbot
parent 20acf3ecfd
commit d73e8fb041

View file

@ -301,10 +301,11 @@ the GPG agent correctly."
(defun find-cargo-project (dir) (defun find-cargo-project (dir)
"Attempt to find the current project in `project-find-functions' "Attempt to find the current project in `project-find-functions'
by looking for a `Cargo.toml' file." by looking for a `Cargo.toml' file."
(unless (equal "/" dir) (when dir
(if (f-exists-p (f-join dir "Cargo.toml")) (unless (equal "/" dir)
(cons 'transient dir) (if (f-exists-p (f-join dir "Cargo.toml"))
(find-cargo-project (f-parent dir))))) (cons 'transient dir)
(find-cargo-project (f-parent dir))))))
(add-to-list 'project-find-functions #'find-cargo-project) (add-to-list 'project-find-functions #'find-cargo-project)