Remove Box on callback traits.

This commit is contained in:
Stephen Chung
2022-01-27 23:55:32 +08:00
parent 64de20bcd3
commit e476929597
7 changed files with 66 additions and 53 deletions

View File

@@ -115,17 +115,17 @@ pub struct Engine {
/// Custom syntax.
pub(crate) custom_syntax: BTreeMap<Identifier, Box<CustomSyntax>>,
/// Callback closure for resolving variable access.
pub(crate) resolve_var: Option<OnVarCallback>,
pub(crate) resolve_var: Option<Box<OnVarCallback>>,
/// Callback closure to remap tokens during parsing.
pub(crate) token_mapper: Option<Box<OnParseTokenCallback>>,
/// Callback closure for implementing the `print` command.
pub(crate) print: Option<OnPrintCallback>,
pub(crate) print: Option<Box<OnPrintCallback>>,
/// Callback closure for implementing the `debug` command.
pub(crate) debug: Option<OnDebugCallback>,
pub(crate) debug: Option<Box<OnDebugCallback>>,
/// Callback closure for progress reporting.
#[cfg(not(feature = "unchecked"))]
pub(crate) progress: Option<crate::func::native::OnProgressCallback>,
pub(crate) progress: Option<Box<crate::func::native::OnProgressCallback>>,
/// Optimize the [`AST`][crate::AST] after compilation.
#[cfg(not(feature = "no_optimize"))]
@@ -140,7 +140,7 @@ pub struct Engine {
/// Callback closure for debugging.
#[cfg(feature = "debugging")]
pub(crate) debugger: Option<crate::eval::OnDebuggerCallback>,
pub(crate) debugger: Option<Box<crate::eval::OnDebuggerCallback>>,
}
impl fmt::Debug for Engine {