From 15ce644decb0d5fbac368e03b4a5addb9731e5d7 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 13 Nov 2022 18:36:52 +0100 Subject: [PATCH] Clarify ancestor usage in workspace detection --- nih_plug_xtask/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nih_plug_xtask/src/lib.rs b/nih_plug_xtask/src/lib.rs index a54c4092..7150d3e2 100644 --- a/nih_plug_xtask/src/lib.rs +++ b/nih_plug_xtask/src/lib.rs @@ -166,6 +166,8 @@ pub fn chdir_workspace_root() -> Result<()> { let workspace_root = project_dir .ancestors() .filter(|dir| dir.join("Cargo.toml").exists()) + // The ancestors are ordered starting from `project_dir` going up to the filesystem root. So + // this is the leftmost matching ancestor. .last() .with_context(|| { format!(