@@ -466,7 +466,9 @@ fn _list_files(pkg: &Package, gctx: &GlobalContext) -> CargoResult<Vec<PathBuf>>
466
466
return list_files_gix ( pkg, & repo, & filter, gctx) ;
467
467
}
468
468
}
469
- list_files_walk ( pkg, & filter, gctx)
469
+ let mut ret = Vec :: new ( ) ;
470
+ list_files_walk ( pkg. root ( ) , & mut ret, true , & filter, gctx) ?;
471
+ Ok ( ret)
470
472
}
471
473
472
474
/// Returns [`Some(gix::Repository)`](gix::Repository) if the discovered repository
@@ -637,7 +639,7 @@ fn list_files_gix(
637
639
files. extend ( list_files_gix ( pkg, & sub_repo, filter, gctx) ?) ;
638
640
}
639
641
Err ( _) => {
640
- walk ( & file_path, & mut files, false , filter, gctx) ?;
642
+ list_files_walk ( & file_path, & mut files, false , filter, gctx) ?;
641
643
}
642
644
}
643
645
} else if ( filter) ( & file_path, is_dir) {
@@ -656,17 +658,6 @@ fn list_files_gix(
656
658
/// This is a fallback for [`list_files_gix`] when the package
657
659
/// is not tracked under a Git repository.
658
660
fn list_files_walk (
659
- pkg : & Package ,
660
- filter : & dyn Fn ( & Path , bool ) -> bool ,
661
- gctx : & GlobalContext ,
662
- ) -> CargoResult < Vec < PathBuf > > {
663
- let mut ret = Vec :: new ( ) ;
664
- walk ( pkg. root ( ) , & mut ret, true , filter, gctx) ?;
665
- Ok ( ret)
666
- }
667
-
668
- /// Helper recursive function for [`list_files_walk`].
669
- fn walk (
670
661
path : & Path ,
671
662
ret : & mut Vec < PathBuf > ,
672
663
is_root : bool ,
0 commit comments