From bc24fe35b6c7cf1065356f8c30153c3f1d5cc819 Mon Sep 17 00:00:00 2001 From: Tim Schubert Date: Sat, 9 Aug 2025 20:06:20 +0200 Subject: [PATCH] fix: speed up checking if dir is empty --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 8eade4b..084d0f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,7 +43,7 @@ impl + AsRef> SrcRoot { fn ensure_repo_checkout(&self, url: &Url) -> Result { 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)?; self.clone_repo(url)?; }