diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-04-12 00:09:43 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-04-12 00:41:08 +0300 |
| commit | 4ded0b82caf33969d44b47c20afcbde4cf523424 (patch) | |
| tree | 49224a320ae543af1a5e61100c6c221010567003 /compiler/rustc_session/src/filesearch.rs | |
| parent | aa6a697a1c75b0aa06954136f7641706edadc2be (diff) | |
| download | rust-4ded0b82caf33969d44b47c20afcbde4cf523424.tar.gz rust-4ded0b82caf33969d44b47c20afcbde4cf523424.zip | |
linker: Avoid some allocations in search directory iteration
Diffstat (limited to 'compiler/rustc_session/src/filesearch.rs')
| -rw-r--r-- | compiler/rustc_session/src/filesearch.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_session/src/filesearch.rs b/compiler/rustc_session/src/filesearch.rs index 4f0e3354680..6120900d9f4 100644 --- a/compiler/rustc_session/src/filesearch.rs +++ b/compiler/rustc_session/src/filesearch.rs @@ -47,8 +47,8 @@ impl<'a> FileSearch<'a> { } /// Returns just the directories within the search paths. - pub fn search_path_dirs(&self) -> Vec<PathBuf> { - self.search_paths().map(|sp| sp.dir.to_path_buf()).collect() + pub fn search_path_dirs(&self) -> impl Iterator<Item = &'a Path> { + self.search_paths().map(|sp| &*sp.dir) } } |
