diff --git a/src/main.rs b/src/main.rs index ea4163f..10eeb96 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,23 +41,17 @@ extern { } type PLIGenerator = Box Box + Send + Sync>; fn main() { - let languages: Vec> = - vec![ - Box::new(schala_lang::Schala::new()), - Box::new(maaru_lang::Maaru::new()), - Box::new(robo_lang::Robo::new()), - ]; - let generators: Vec = vec![ Box::new(|| { let x: Box = Box::new(schala_lang::Schala::new()); x }), Box::new(|| { let x: Box = Box::new(maaru_lang::Maaru::new()); x }), Box::new(|| { let x: Box = Box::new(robo_lang::Robo::new()); x }), ]; - schala_main(languages, generators); + schala_main(generators); } -fn schala_main(languages: Vec>, generators: Vec) { +fn schala_main(generators: Vec) { + let languages: Vec> = generators.iter().map(|x| x()).collect(); let option_matches = program_options().parse(std::env::args()).unwrap_or_else(|e| { println!("{:?}", e);