return valid;
}
-pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
- -> test::TestDescAndFn {
+pub fn make_test<F>(config: &Config, testfile: &Path, f: F) -> test::TestDescAndFn where
+ F: FnOnce() -> test::TestFn,
+{
test::TestDescAndFn {
desc: test::TestDesc {
name: make_test_name(config, testfile),
!val
}
-fn iter_header(testfile: &Path, it: |&str| -> bool) -> bool {
+fn iter_header<F>(testfile: &Path, mut it: F) -> bool where
+ F: FnMut(&str) -> bool,
+{
use std::io::{BufferedReader, File};
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
ThisDirectory(Path),
}
-fn make_compile_args(config: &Config,
- props: &TestProps,
- extras: Vec<String> ,
- xform: |&Config, &Path| -> TargetLocation,
- testfile: &Path)
- -> ProcArgs {
+fn make_compile_args<F>(config: &Config,
+ props: &TestProps,
+ extras: Vec<String> ,
+ xform: F,
+ testfile: &Path)
+ -> ProcArgs where
+ F: FnOnce(&Config, &Path) -> TargetLocation,
+{
let xform_file = xform(config, testfile);
let target = if props.force_host {
config.host.as_slice()