make it possible to execute an lua file and code block in the same module
This commit is contained in:
parent
fec6f7f274
commit
44b6eecd70
@ -125,14 +125,12 @@ impl EventLoop for LuaModule {
|
||||
sender: Box::new(sender.clone())
|
||||
});
|
||||
|
||||
match self.code {
|
||||
Some(ref code) => { lua.execute(&code).unwrap() },
|
||||
None => {
|
||||
match self.file {
|
||||
Some(ref file) => { lua.execute_from_reader::<(), _>(File::open(&Path::new(file)).unwrap()).unwrap(); }
|
||||
None => {}
|
||||
}
|
||||
if let Some(ref file) = self.file {
|
||||
lua.execute_from_reader::<(), _>(File::open(&Path::new(file)).unwrap()).unwrap();
|
||||
}
|
||||
|
||||
if let Some(ref code) = self.code {
|
||||
lua.execute(&code).unwrap()
|
||||
}
|
||||
|
||||
loop {
|
||||
|
Loading…
x
Reference in New Issue
Block a user