Add no_object feature to disable objects.

This commit is contained in:
Stephen Chung
2020-03-29 17:15:12 +08:00
parent a8a4ed2967
commit ef6c6ea6d2
16 changed files with 71 additions and 15 deletions

View File

@@ -15,6 +15,8 @@ impl TestStruct {
}
}
#[cfg(not(feature = "no_index"))]
#[cfg(not(feature = "no_object"))]
fn main() {
let mut engine = Engine::new();
@@ -32,3 +34,6 @@ fn main() {
engine.eval::<TestStruct>("let x = [new_ts()]; x[0].update(); x[0]")
);
}
#[cfg(any(feature = "no_index", feature = "no_object"))]
fn main() {}

View File

@@ -15,6 +15,7 @@ impl TestStruct {
}
}
#[cfg(not(feature = "no_object"))]
fn main() -> Result<(), EvalAltResult> {
let mut engine = Engine::new();
@@ -29,3 +30,6 @@ fn main() -> Result<(), EvalAltResult> {
Ok(())
}
#[cfg(feature = "no_object")]
fn main() {}