Skip to content

Commit

Permalink
Avoid a Vec allocation
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.
  • Loading branch information
Harrison Kaiser committed Oct 25, 2023
1 parent 1ab3ac2 commit 8041b48
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 8041b48

Please sign in to comment.