From cd3b076a68b05611d9de8f76fcaeb6d07148d9b0 Mon Sep 17 00:00:00 2001 From: qumn Date: Wed, 1 Jan 2025 22:31:57 +0800 Subject: [PATCH] fix: correct Vec capacity allocation caused by variable name shadowing. --- 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 {