}
};
- let mut filter = |path: &Path, is_dir: bool| {
+ let filter = |path: &Path, is_dir: bool| {
let relative_path = match path.strip_prefix(root) {
Ok(p) => p,
Err(_) => return false,
// Attempt Git-prepopulate only if no `include` (see rust-lang/cargo#4135).
if no_include_option {
if let Some(repo) = git_repo {
- return self.list_files_git(pkg, &repo, &mut filter);
+ return self.list_files_git(pkg, &repo, &filter);
}
}
- self.list_files_walk(pkg, &mut filter)
+ self.list_files_walk(pkg, &filter)
}
/// Returns `Some(git2::Repository)` if found sibling `Cargo.toml` and `.git`
&self,
pkg: &Package,
repo: &git2::Repository,
- filter: &mut dyn FnMut(&Path, bool) -> bool,
+ filter: &dyn Fn(&Path, bool) -> bool,
) -> CargoResult<Vec<PathBuf>> {
warn!("list_files_git {}", pkg.package_id());
let index = repo.index()?;
fn list_files_walk(
&self,
pkg: &Package,
- filter: &mut dyn FnMut(&Path, bool) -> bool,
+ filter: &dyn Fn(&Path, bool) -> bool,
) -> CargoResult<Vec<PathBuf>> {
let mut ret = Vec::new();
self.walk(pkg.root(), &mut ret, true, filter)?;
path: &Path,
ret: &mut Vec<PathBuf>,
is_root: bool,
- filter: &mut dyn FnMut(&Path, bool) -> bool,
+ filter: &dyn Fn(&Path, bool) -> bool,
) -> CargoResult<()> {
let walkdir = WalkDir::new(path)
.follow_links(true)