Skip to content

Commit b9716f0

Browse files
committed
refactor(cli): Update Lua VM usage with improved generic handling
1 parent 055a68e commit b9716f0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn inject_version(lua: &Lua) {
6060
pub fn load_sile(lua: &Lua) {
6161
let entry: LuaString = lua.create_string("core.sile").unwrap();
6262
let require: LuaFunction = lua.globals().get("require").unwrap();
63-
require.call::<LuaString, ()>(entry).unwrap();
63+
require.call::<LuaTable>(entry).unwrap();
6464
}
6565

6666
pub fn version() -> crate::Result<String> {
@@ -153,7 +153,7 @@ pub fn run(
153153
eprintln!("{full_version}");
154154
}
155155
let init: LuaFunction = sile.get("init")?;
156-
init.call::<_, ()>(())?;
156+
init.call::<LuaValue>(())?;
157157
if let Some(inputs) = inputs {
158158
let input_filenames: LuaTable = lua.create_table()?;
159159
for input in inputs.iter() {
@@ -175,20 +175,20 @@ pub fn run(
175175
let spec = spec?;
176176
let module: LuaString = spec.get("module")?;
177177
let options: LuaTable = spec.get("options")?;
178-
r#use.call::<(LuaString, LuaTable), ()>((module, options))?;
178+
r#use.call::<(LuaString, LuaTable)>((module, options))?;
179179
}
180180
let input_filenames: LuaTable = sile_input.get("filenames")?;
181181
let process_file: LuaFunction = sile.get("processFile")?;
182182
for file in input_filenames.sequence_values::<LuaString>() {
183-
process_file.call::<LuaString, ()>(file?)?;
183+
process_file.call::<LuaString>(file?)?;
184184
}
185185
let finish: LuaFunction = sile.get("finish")?;
186-
finish.call::<_, ()>(())?;
186+
finish.call::<LuaValue>(())?;
187187
} else {
188188
let repl_module: LuaString = lua.create_string("core.repl")?;
189189
let require: LuaFunction = lua.globals().get("require")?;
190-
let repl: LuaTable = require.call::<LuaString, LuaTable>(repl_module)?;
191-
repl.call_method::<_, ()>("enter", ())?;
190+
let repl: LuaTable = require.call::<LuaTable>(repl_module)?;
191+
repl.call_method::<LuaValue>("enter", ())?;
192192
}
193193
Ok(())
194194
}

0 commit comments

Comments
 (0)