Skip to content

Commit

Permalink
Avoid a Vec allocation (#867)
Browse files Browse the repository at this point in the history
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.

Co-authored-by: Harrison Kaiser <[email protected]>
  • Loading branch information
harrisonkaiser and Harrison Kaiser authored Oct 28, 2023
1 parent 1ae170a commit a9ee9e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(""),
));
}
}
Expand Down

0 comments on commit a9ee9e0

Please sign in to comment.