]> git.lizzy.rs Git - rust.git/commitdiff
rustc: replace `pick` alias with an unboxed closure
authorJorge Aparicio <japaricious@gmail.com>
Wed, 31 Dec 2014 03:49:26 +0000 (22:49 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Thu, 1 Jan 2015 03:50:27 +0000 (22:50 -0500)
src/librustc/metadata/filesearch.rs

index cc67f3ddf0330af6f9141a2620b6a7e403d902f2..82071931fe3a654253b4907350f2c321d22efd38 100644 (file)
@@ -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 @@ pub fn get_lib_path(&self) -> Path {
         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) {