From 40fea8521ecc4b6b17532462002a084c43632016 Mon Sep 17 00:00:00 2001 From: qumn <62603356+qumn@users.noreply.github.com> Date: Wed, 1 Jan 2025 22:45:32 +0800 Subject: [PATCH] fix: correct Vec capacity allocation caused by variable name shadowing (#2139) --- yazi-fs/src/files.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yazi-fs/src/files.rs b/yazi-fs/src/files.rs index c2bf8e23..280699af 100644 --- a/yazi-fs/src/files.rs +++ b/yazi-fs/src/files.rs @@ -61,7 +61,7 @@ impl Files { let (first, rest) = entries.split_at(entries.len() / 3); let (second, third) = rest.split_at(entries.len() / 3); async fn go(entries: &[DirEntry]) -> Vec { - let mut files = Vec::with_capacity(entries.len() / 3 + 1); + let mut files = Vec::with_capacity(entries.len()); for entry in entries { let url = Url::from(entry.path()); files.push(match entry.metadata().await {