From cae3afc758eb7c4a24a77e03aae924c210ab7ffe Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Sun, 3 Nov 2024 21:28:32 +0100 Subject: [PATCH] feat(tvix/eval): use with_capacity instead of a growing vec Change-Id: I4d89663eb9ac772ce1008ed5ee218bc7016164e7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12733 Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/eval/src/value/json.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tvix/eval/src/value/json.rs b/tvix/eval/src/value/json.rs index 1ef3f9911..807dc55f9 100644 --- a/tvix/eval/src/value/json.rs +++ b/tvix/eval/src/value/json.rs @@ -40,7 +40,7 @@ impl Value { } Value::List(l) => { - let mut out = vec![]; + let mut out = Vec::with_capacity(l.len()); for val in l.into_iter() { let (json_item, ctx) = Box::pin(val.into_contextful_json(co)).await?;