fix: speed up checking if dir is empty
This commit is contained in:
parent
7aae7f84d8
commit
bc24fe35b6
1 changed files with 1 additions and 1 deletions
|
|
@ -43,7 +43,7 @@ impl<T: AsRef<Path> + AsRef<OsStr>> SrcRoot<T> {
|
||||||
|
|
||||||
fn ensure_repo_checkout(&self, url: &Url) -> Result<PathBuf> {
|
fn ensure_repo_checkout(&self, url: &Url) -> Result<PathBuf> {
|
||||||
let repo_path = self.as_repo_path(url);
|
let repo_path = self.as_repo_path(url);
|
||||||
if !repo_path.is_dir() || repo_path.read_dir()?.count() == 0 {
|
if !repo_path.is_dir() || repo_path.read_dir()?.next().is_none() {
|
||||||
create_dir_all(&repo_path)?;
|
create_dir_all(&repo_path)?;
|
||||||
self.clone_repo(url)?;
|
self.clone_repo(url)?;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue