Skip to content

Commit f902e6f

Browse files
fwilliams42makspll
andauthored
chore: bump mlua to 0.11 (#542)
Co-authored-by: Maksymilian Mozolewski <makspl17@gmail.com>
1 parent 777353d commit f902e6f

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ dot-writer = { version = "0.1.4", default-features = false }
215215
parking_lot = { version = "0.12.1", default-features = false }
216216
strum = { version = "0.26", default-features = false }
217217
rhai = { version = "1.21", default-features = false }
218-
mlua = { version = "0.10", default-features = false }
218+
mlua = { version = "0.11", default-features = false }
219219
log = { version = "0.4", default-features = false }
220220
env_logger = { version = "0.11", default-features = false }
221221
clap = { version = "4", default-features = false, features = ["std"] }

crates/languages/bevy_mod_scripting_lua/src/bindings/script_value.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,7 @@ impl FromLua for LuaScriptValue {
111111
Value::Nil => ScriptValue::Unit,
112112
Value::Boolean(b) => ScriptValue::Bool(b),
113113
// Value::LightUserData(light_user_data) => todo!(),
114-
#[cfg(not(feature = "luau"))]
115114
Value::Integer(i) => ScriptValue::Integer(i),
116-
#[cfg(feature = "luau")]
117-
Value::Integer(i) => ScriptValue::Integer(i as i64),
118115
Value::Number(n) => ScriptValue::Float(n),
119116
Value::String(s) => ScriptValue::String(s.to_str()?.to_owned().into()),
120117
Value::Function(f) => ScriptValue::Function(
@@ -187,10 +184,7 @@ impl IntoLua for LuaScriptValue {
187184
Ok(match self.0 {
188185
ScriptValue::Unit => Value::Nil,
189186
ScriptValue::Bool(b) => Value::Boolean(b),
190-
#[cfg(not(feature = "luau"))]
191187
ScriptValue::Integer(i) => Value::Integer(i),
192-
#[cfg(feature = "luau")]
193-
ScriptValue::Integer(i) => Value::Integer(i as i32),
194188
ScriptValue::Float(f) => Value::Number(f),
195189
ScriptValue::String(s) => Value::String(lua.create_string(s.as_ref())?),
196190
ScriptValue::Reference(r) => LuaReflectReference::from(r).into_lua(lua)?,
@@ -199,8 +193,8 @@ impl IntoLua for LuaScriptValue {
199193
.create_function(move |lua, args: MultiLuaScriptValue| {
200194
let loc = {
201195
profiling::scope!("function call context");
202-
lua.inspect_stack(1).map(|debug| LocationContext {
203-
line: debug.curr_line().try_into().unwrap_or_default(),
196+
lua.inspect_stack(1, |debug| LocationContext {
197+
line: debug.current_line().unwrap_or_default() as u32,
204198
col: None,
205199
script_name: lua.app_data_ref::<LuaContextAppData>().and_then(|v| {
206200
v.last_loaded_script_name.as_ref().map(|n| n.to_string())
@@ -221,8 +215,8 @@ impl IntoLua for LuaScriptValue {
221215
.create_function(move |lua, args: MultiLuaScriptValue| {
222216
let loc = {
223217
profiling::scope!("function call context");
224-
lua.inspect_stack(1).map(|debug| LocationContext {
225-
line: debug.curr_line().try_into().unwrap_or_default(),
218+
lua.inspect_stack(1, |debug| LocationContext {
219+
line: debug.current_line().unwrap_or_default() as u32,
226220
col: None,
227221
script_name: lua.app_data_ref::<LuaContextAppData>().and_then(|v| {
228222
v.last_loaded_script_name.as_ref().map(|n| n.to_string())

0 commit comments

Comments
 (0)