File tree 1 file changed +3
-4
lines changed 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -1703,17 +1703,16 @@ fn find_workspace_root_with_loader(
1703
1703
) -> CargoResult < Option < PathBuf > > {
1704
1704
// Check if there are any workspace roots that have already been found that would work
1705
1705
{
1706
- let mut parent = manifest_path. parent ( ) ;
1707
1706
let roots = config. ws_roots . borrow ( ) ;
1708
- while let Some ( current) = parent {
1707
+ // Iterate through the manifests parent directories until we find a workspace
1708
+ // root. Note we skip the first item since that is just the path itself
1709
+ for current in manifest_path. ancestors ( ) . skip ( 1 ) {
1709
1710
if let Some ( ws_config) = roots. get ( current) {
1710
1711
if !ws_config. is_excluded ( manifest_path) {
1711
1712
// Add `Cargo.toml` since ws_root is the root and not the file
1712
1713
return Ok ( Some ( current. join ( "Cargo.toml" ) ) ) ;
1713
1714
}
1714
1715
}
1715
-
1716
- parent = current. parent ( ) ;
1717
1716
}
1718
1717
}
1719
1718
You can’t perform that action at this time.
0 commit comments