From bf0ed47cebfff203be3f0cb7cd69e1993464327b Mon Sep 17 00:00:00 2001 From: unittensor Date: Sat, 20 Jan 2024 23:03:37 -0500 Subject: [PATCH] Temporary return solution fighting the borrow checker --- src/luau.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/luau.rs b/src/luau.rs index 4aa0cae..1d85ee4 100644 --- a/src/luau.rs +++ b/src/luau.rs @@ -29,7 +29,7 @@ impl<'a> StrafeluaGlobals<'a> { } } -pub fn new_state() -> Result { +pub fn new_state() -> Result<()> { let vm = Luau::new(); vm.sandbox(true).unwrap(); //Prevent bad actors @@ -44,7 +44,6 @@ pub fn new_state() -> Result { vm.globals().set("Player", strafe_player).unwrap(); vm.globals().set("Vector3", strafe_vector3).unwrap(); - let gib = *strafe_globals.current_vm; let _ = vm.load(r#" type f64 = number type vec3 = (x: f64, y: f64, z: f64) -> {x: f64, y: f64, z: f64} @@ -54,5 +53,5 @@ local v3 = Vector3(-10, 30, 50) print((`{("\n"):rep(3)} x=%d,y=%d,z=%d {("\n"):rep(3)}`):format(v3.x, v3.y, v3.z)) "#).exec(); - Ok(gib) + Ok(()) } \ No newline at end of file