mirror of
https://github.com/redstrate/Kawari.git
synced 2025-07-09 23:47:46 +00:00
Address two of "warning: function call inside of expect
"
This commit is contained in:
parent
72915e11d9
commit
b3b7b2e57f
1 changed files with 6 additions and 5 deletions
|
@ -537,9 +537,10 @@ async fn client_loop(
|
||||||
let connection_data = scope
|
let connection_data = scope
|
||||||
.create_userdata_ref_mut(&mut lua_player)?;
|
.create_userdata_ref_mut(&mut lua_player)?;
|
||||||
|
|
||||||
|
/* TODO: Instead of panicking we ought to send a message to the player
|
||||||
|
* and the console log, and abandon execution. */
|
||||||
lua.load(
|
lua.load(
|
||||||
std::fs::read(&file_name)
|
std::fs::read(&file_name).unwrap_or_else(|_| panic!("Failed to load script file {}!", &file_name)),
|
||||||
.expect(format!("Failed to load script file {}!", &file_name).as_str()),
|
|
||||||
)
|
)
|
||||||
.set_name("@".to_string() + &file_name)
|
.set_name("@".to_string() + &file_name)
|
||||||
.exec()?;
|
.exec()?;
|
||||||
|
@ -643,10 +644,10 @@ async fn client_loop(
|
||||||
lua.scope(|scope| {
|
lua.scope(|scope| {
|
||||||
let connection_data = scope
|
let connection_data = scope
|
||||||
.create_userdata_ref_mut(&mut lua_player)?;
|
.create_userdata_ref_mut(&mut lua_player)?;
|
||||||
|
/* TODO: Instead of panicking we ought to send a message to the player
|
||||||
|
* and the console log, and abandon execution. */
|
||||||
lua.load(
|
lua.load(
|
||||||
std::fs::read(&file_name)
|
std::fs::read(&file_name).unwrap_or_else(|_| panic!("Failed to load script file {}!", &file_name)),
|
||||||
.expect(format!("Failed to load script file {}!", &file_name).as_str()),
|
|
||||||
)
|
)
|
||||||
.set_name("@".to_string() + &file_name)
|
.set_name("@".to_string() + &file_name)
|
||||||
.exec()?;
|
.exec()?;
|
||||||
|
|
Loading…
Add table
Reference in a new issue