From 7ef6773c006d2fae1d705f6e9464758ff7d4eeb1 Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Mon, 10 Oct 2022 00:42:59 +0300 Subject: [PATCH] Get rid of double-borrow --- ops/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ops/lib.rs b/ops/lib.rs index 1713b856703da2..a277e94495b15e 100644 --- a/ops/lib.rs +++ b/ops/lib.rs @@ -460,7 +460,7 @@ fn codegen_fast_impl( } else { quote! { let isolate = { - let mut isolate_ptr = ::std::cell::RefCell::borrow(&ctx.state).isolate_ptr; + let isolate_ptr = ::std::cell::RefCell::borrow(&ctx.state).isolate_ptr; if isolate_ptr.is_null() { opts.fallback = true; return Default::default(); @@ -585,9 +585,11 @@ fn codegen_v8_sync( { let mut op_state = ::std::cell::RefCell::borrow_mut(&ctx.state); if let Some(err) = op_state.last_fast_op_error.take() { + let get_error_class_fn = op_state.get_error_class_fn; + ::std::mem::drop(op_state); let exception = #core::error::to_v8_error( scope, - op_state.get_error_class_fn, + get_error_class_fn, &err ); scope.throw_exception(exception);