From 930ac1c331246b7c9aede5fd2bcdfb20936dc5ee Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 20 Sep 2024 17:53:55 -0700 Subject: [PATCH] cframe: fixup FromLua --- src/runner/cframe.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runner/cframe.rs b/src/runner/cframe.rs index 690aeb3..8536204 100644 --- a/src/runner/cframe.rs +++ b/src/runner/cframe.rs @@ -43,9 +43,9 @@ impl mlua::UserData for CFrame{ } impl<'lua> mlua::FromLua<'lua> for CFrame{ 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 CFrame got {:?}",other))), } } }