fix: correct Vec capacity allocation caused by variable name shadowing.

This commit is contained in:
qumn 2025-01-01 22:31:57 +08:00
parent 2770e0259c
commit cd3b076a68

View file

@ -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<File> {
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 {