Simplify main
This commit is contained in:
parent
85efc46201
commit
f8446971d6
@ -10,9 +10,9 @@ mod data;
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut args = std::env::args().skip(1);
|
let mut args = std::env::args().skip(1);
|
||||||
let spec: Box<dyn Edition> = match args.next().as_deref().map(str::to_lowercase).as_deref() {
|
let spec: &dyn Edition = match args.next().as_deref().map(str::to_lowercase).as_deref() {
|
||||||
Some("luau") => Box::new(Luau),
|
Some("luau") => &Luau,
|
||||||
Some("luajit") => Box::new(LuaJIT),
|
Some("luajit") => &LuaJIT,
|
||||||
_ => {
|
_ => {
|
||||||
println!("expected either 'luau' or 'luajit' option");
|
println!("expected either 'luau' or 'luajit' option");
|
||||||
return;
|
return;
|
||||||
@ -25,6 +25,6 @@ fn main() {
|
|||||||
let wasm = deserialize_file(v).unwrap();
|
let wasm = deserialize_file(v).unwrap();
|
||||||
let module = Module::new(&wasm);
|
let module = Module::new(&wasm);
|
||||||
|
|
||||||
level_3::translate(spec.as_ref(), &module, &mut output.lock()).unwrap();
|
level_3::translate(spec, &module, &mut output.lock()).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user