Revert "Refine examples."

This reverts commit 146129279c.
This commit is contained in:
Stephen Chung
2022-01-16 22:50:39 +08:00
parent 146129279c
commit 5935a88958
6 changed files with 43 additions and 32 deletions

View File

@@ -1,6 +1,3 @@
#![cfg(not(feature = "no_index"))]
#![cfg(not(feature = "no_object"))]
use rhai::{Engine, EvalAltResult};
#[derive(Debug, Clone)]
@@ -17,6 +14,8 @@ impl TestStruct {
}
}
#[cfg(not(feature = "no_index"))]
#[cfg(not(feature = "no_object"))]
fn main() -> Result<(), Box<EvalAltResult>> {
let mut engine = Engine::new();
@@ -47,3 +46,8 @@ 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'.")
}