indexed_docs: Remove some unnecessary cloning (#30236)

Other small patch to reduce allocations.

`.iter().cloned().collect()` calls `Clone` per element, whereas
`.into_iter().collect()` preallocates the `Vec`.

The Zed repo for example has up to 1700 packages on some build
configurations, meaning this change theoretically saves up to 1699
allocations. It's likely the compiler has already optimized this away,
but it's good to be explicit.

Release Notes:

- N/A
4b5158b168tidely committed on 5/8/2025, 10:59:56 AM· committed by GitHubparenta61958e
1 file changedLine totals unavailable