Refine examples.

This commit is contained in:
Stephen Chung
2022-01-16 22:45:49 +08:00
parent d843baca12
commit 146129279c
6 changed files with 32 additions and 43 deletions

View File

@@ -1,3 +1,6 @@
#![cfg(not(feature = "no_index"))]
#![cfg(not(feature = "no_object"))]
use rhai::{Engine, EvalAltResult};
#[derive(Debug, Clone)]
@@ -14,8 +17,6 @@ impl TestStruct {
}
}
#[cfg(not(feature = "no_index"))]
#[cfg(not(feature = "no_object"))]
fn main() -> Result<(), Box<EvalAltResult>> {
let mut engine = Engine::new();
@@ -46,8 +47,3 @@ fn main() -> Result<(), Box<EvalAltResult>> {
Ok(())
}
#[cfg(any(feature = "no_index", feature = "no_object"))]
fn main() {
panic!("This example does not run under 'no_index' or 'no_object'.")
}