diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2014-12-30 22:49:26 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2014-12-31 22:50:27 -0500 |
| commit | c8cf3a307b94349cd4948a860d62730945e8d805 (patch) | |
| tree | 27a43cac33f0a3e0d2976aa1cac8efa0e1e3b3cb | |
| parent | 1d21dad1d29d57875ff47b38e5894668f5bec6f9 (diff) | |
rustc: replace `pick` alias with an unboxed closure
| -rw-r--r-- | src/librustc/metadata/filesearch.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index cc67f3ddf03..82071931fe3 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -30,10 +30,6 @@ pub enum FileMatch { // FIXME (#2658): I'm not happy how this module turned out. Should // probably just be folded into cstore. -/// Functions with type `pick` take a parent directory as well as -/// a file found in that directory. -pub type pick<'a> = |path: &Path|: 'a -> FileMatch; - pub struct FileSearch<'a> { pub sysroot: &'a Path, pub search_paths: &'a SearchPaths, @@ -95,7 +91,7 @@ impl<'a> FileSearch<'a> { make_target_lib_path(self.sysroot, self.triple) } - pub fn search(&self, pick: pick) { + pub fn search<F>(&self, mut pick: F) where F: FnMut(&Path) -> FileMatch { self.for_each_lib_search_path(|lib_search_path| { debug!("searching {}", lib_search_path.display()); match fs::readdir(lib_search_path) { |
