Move optimization_level into Options.

This commit is contained in:
Stephen Chung
2022-03-29 08:26:42 +08:00
parent 1b6de25007
commit 56f6b181db
6 changed files with 24 additions and 17 deletions

View File

@@ -9,8 +9,7 @@ use crate::packages::{Package, StandardPackage};
use crate::tokenizer::Token;
use crate::types::dynamic::Union;
use crate::{
Dynamic, Identifier, ImmutableString, Module, OptimizationLevel, Position, RhaiResult, Shared,
StaticVec,
Dynamic, Identifier, ImmutableString, Module, Position, RhaiResult, Shared, StaticVec,
};
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
@@ -129,9 +128,6 @@ pub struct Engine {
#[cfg(not(feature = "unchecked"))]
pub(crate) progress: Option<Box<crate::func::native::OnProgressCallback>>,
/// Optimize the [`AST`][crate::AST] after compilation.
pub(crate) optimization_level: OptimizationLevel,
/// Language options.
pub(crate) options: LanguageOptions,
@@ -167,9 +163,6 @@ impl fmt::Debug for Engine {
#[cfg(not(feature = "unchecked"))]
f.field("progress", &self.progress.is_some());
#[cfg(not(feature = "no_optimize"))]
f.field("optimization_level", &self.optimization_level);
f.field("options", &self.options);
#[cfg(not(feature = "unchecked"))]
@@ -274,8 +267,6 @@ impl Engine {
#[cfg(not(feature = "unchecked"))]
progress: None,
optimization_level: OptimizationLevel::default(),
options: LanguageOptions::new(),
#[cfg(not(feature = "unchecked"))]