Open
Description
Here's a reasonable pattern:
let mut results = Vec::new();
for ... {
results.append(new_results);
}
On the first append, we can just swap ourselves with the rhs, avoiding an allocation and copy. This is annoying for our users to remember to do, and is basically free to support given how much work this method otherwise does.
It should perhaps only be done if lhs.capacity is 0, just because we don't want to mess up a user who has preallocated a nice big buffer. Maybe lhs.capacity < rhs.capacity?