From 8041b48c22bcdf02b72e8b7e370d8d9d7268c6d5 Mon Sep 17 00:00:00 2001 From: Harrison Kaiser Date: Wed, 25 Oct 2023 10:41:41 -0400 Subject: [PATCH] Avoid a Vec allocation This was found using clippy with `-D clippy::perf`. Since we know the size of the slice at compile time, we can avoid heap allocating a Vec. --- src/renderer/processor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/processor.rs b/src/renderer/processor.rs index 41031eff..56c6c486 100644 --- a/src/renderer/processor.rs +++ b/src/renderer/processor.rs @@ -1002,7 +1002,7 @@ impl<'a> Processor<'a> { } if !found && !ignore_missing { return Err(Error::template_not_found( - vec!["[", &tpl_names.join(", "), "]"].join(""), + ["[", &tpl_names.join(", "), "]"].join(""), )); } }