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())
|
sender: Box::new(sender.clone())
|
||||||
});
|
});
|
||||||
|
|
||||||
match self.code {
|
if let Some(ref file) = self.file {
|
||||||
Some(ref code) => { lua.execute(&code).unwrap() },
|
lua.execute_from_reader::<(), _>(File::open(&Path::new(file)).unwrap()).unwrap();
|
||||||
None => {
|
}
|
||||||
match self.file {
|
|
||||||
Some(ref file) => { lua.execute_from_reader::<(), _>(File::open(&Path::new(file)).unwrap()).unwrap(); }
|
if let Some(ref code) = self.code {
|
||||||
None => {}
|
lua.execute(&code).unwrap()
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user