Rewrite `resolve_imports` to use an iterator
Rewrite `resolve_imports` to use an iterator

This allows reusing the original vector's allocation

rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer