From 928e1d92213fcb1e85cb4a30a5e8182f00059ea2 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Thu, 31 Oct 2024 18:41:13 +0000 Subject: [PATCH] Revert `&Scope` to `&mut Scope` --- src/state.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/state.rs b/src/state.rs index eb674d7e..ce46c64d 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1470,9 +1470,10 @@ impl Lua { /// lifetimes only outlive the scope lifetime. pub fn scope<'env, R>( &self, - f: impl for<'scope> FnOnce(&'scope Scope<'scope, 'env>) -> Result, + f: impl for<'scope> FnOnce(&'scope mut Scope<'scope, 'env>) -> Result, ) -> Result { - f(&Scope::new(self.lock_arc())) + // TODO: Update to `&Scope` in next major release + f(&mut Scope::new(self.lock_arc())) } /// Attempts to coerce a Lua value into a String in a manner consistent with Lua's internal