diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-02-01 16:32:13 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-02-02 09:06:34 +1100 |
| commit | 89b61ea09f03060ceac3d0a1779dbb4152b6fddd (patch) | |
| tree | d2d87a42b44b0d1a470b4b17c4b6d2f8cc940872 /compiler/rustc_session/src | |
| parent | 47b5d95db8abaaf4fdad878ec3b06dfaa2a1d74f (diff) | |
| download | rust-89b61ea09f03060ceac3d0a1779dbb4152b6fddd.tar.gz rust-89b61ea09f03060ceac3d0a1779dbb4152b6fddd.zip | |
Inline and remove `FileSearch::search`.
It has only a single callsite, and having all the code in one place will make it possible to optimize the search.
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/filesearch.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/compiler/rustc_session/src/filesearch.rs b/compiler/rustc_session/src/filesearch.rs index e6ec16b393b..9200be363ad 100644 --- a/compiler/rustc_session/src/filesearch.rs +++ b/compiler/rustc_session/src/filesearch.rs @@ -5,7 +5,7 @@ use std::fs; use std::iter::FromIterator; use std::path::{Path, PathBuf}; -use crate::search_paths::{PathKind, SearchPath, SearchPathFile}; +use crate::search_paths::{PathKind, SearchPath}; use rustc_fs_util::fix_windows_verbatim_for_gcc; use tracing::debug; @@ -41,19 +41,6 @@ impl<'a> FileSearch<'a> { self.get_lib_path().join("self-contained") } - pub fn search<F>(&self, mut pick: F) - where - F: FnMut(&SearchPathFile, PathKind), - { - for search_path in self.search_paths() { - debug!("searching {}", search_path.dir.display()); - for spf in search_path.files.iter() { - debug!("testing {}", spf.path.display()); - pick(spf, search_path.kind); - } - } - } - pub fn new( sysroot: &'a Path, triple: &'a str, |
