Construction of single-element collections, such as arrays or vectors, for the sole purpose of iteration, can be detrimental to performance. Consider using std::iter::once
instead.
let mut v = vec![1, 2, 3];
for x in v.chain([4]) {}
let mut v = vec![1, 2, 3];
for x in v.chain(std::iter::once(4)) {}