diff --git a/src/runner/instance.rs b/src/runner/instance.rs index 3d9e257..c38e7e4 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -240,12 +240,12 @@ impl mlua::UserData for Instance{ //Find default value .or_else(||db.find_default_property(class,index_str)) { - Some(&rbx_types::Variant::Int32(val))=>return Ok(val.into_lua(lua)), - Some(&rbx_types::Variant::Int64(val))=>return Ok(val.into_lua(lua)), - Some(&rbx_types::Variant::Float32(val))=>return Ok(val.into_lua(lua)), - Some(&rbx_types::Variant::Float64(val))=>return Ok(val.into_lua(lua)), - Some(&rbx_types::Variant::CFrame(cf))=>return Ok(Into::::into(cf).into_lua(lua)), - Some(&rbx_types::Variant::Vector3(v))=>return Ok(Into::::into(v).into_lua(lua)), + Some(&rbx_types::Variant::Int32(val))=>return val.into_lua(lua), + Some(&rbx_types::Variant::Int64(val))=>return val.into_lua(lua), + Some(&rbx_types::Variant::Float32(val))=>return val.into_lua(lua), + Some(&rbx_types::Variant::Float64(val))=>return val.into_lua(lua), + Some(&rbx_types::Variant::CFrame(cf))=>return Into::::into(cf).into_lua(lua), + Some(&rbx_types::Variant::Vector3(v))=>return Into::::into(v).into_lua(lua), other=>println!("instance.properties.get(i)={other:?}"), } //find a function with a matching name @@ -264,14 +264,12 @@ impl mlua::UserData for Instance{ } }) })?{ - return Ok(function.into_lua(lua)); + return function.into_lua(lua); } //find a child with a matching name - Ok( - find_first_child(dom,instance,index_str) - .map(|instance|Instance::new(instance.referent())) - .into_lua(lua) - ) + find_first_child(dom,instance,index_str) + .map(|instance|Instance::new(instance.referent())) + .into_lua(lua) }) }); methods.add_meta_function(mlua::MetaMethod::NewIndex,|lua,(this,index,value):(Instance,mlua::String,mlua::Value)|{