diff --git a/src/runner/vector3.rs b/src/runner/vector3.rs index 7fd6753..36aee3e 100644 --- a/src/runner/vector3.rs +++ b/src/runner/vector3.rs @@ -49,9 +49,9 @@ impl mlua::UserData for Vector3{ impl<'lua> mlua::FromLua<'lua> for Vector3{ fn from_lua(value:mlua::prelude::LuaValue<'lua>,_lua:&'lua mlua::prelude::Lua)->mlua::prelude::LuaResult{ - match value { - mlua::Value::UserData(ud) => Ok(*ud.borrow::()?), - _ => unreachable!(), + match value{ + mlua::Value::UserData(ud)=>ud.take(), + other=>Err(mlua::Error::runtime(format!("Expected Vector3 got {:?}",other))), } } }