Refine auto_restore syntax.

This commit is contained in:
Stephen Chung
2022-12-04 22:47:10 +08:00
parent 3163d9d1d6
commit e2bd0705b1
7 changed files with 64 additions and 32 deletions

View File

@@ -234,7 +234,7 @@ impl Engine {
#[cfg(feature = "debugging")]
let reset = self.run_debugger_with_reset(global, caches, scope, this_ptr, expr)?;
#[cfg(feature = "debugging")]
auto_restore!(global; reset.is_some() => move |g| g.debugger_mut().reset_status(reset));
auto_restore!(global if reset.is_some() => move |g| g.debugger_mut().reset_status(reset));
self.track_operation(global, expr.position())?;
@@ -265,7 +265,7 @@ impl Engine {
#[cfg(feature = "debugging")]
let reset = self.run_debugger_with_reset(global, caches, scope, this_ptr, expr)?;
#[cfg(feature = "debugging")]
auto_restore!(global; reset.is_some() => move |g| g.debugger_mut().reset_status(reset));
auto_restore!(global if reset.is_some() => move |g| g.debugger_mut().reset_status(reset));
self.track_operation(global, expr.position())?;