diff --git a/examples/arrays_and_structs.rs b/examples/arrays_and_structs.rs index 5f7b0f0b..af7246fb 100644 --- a/examples/arrays_and_structs.rs +++ b/examples/arrays_and_structs.rs @@ -1,5 +1,5 @@ extern crate rhai; -use rhai::{Any, Engine, EvalAltResult, RegisterFn}; +use rhai::{Engine, RegisterFn}; #[derive(Clone, Debug)] struct TestStruct { @@ -16,22 +16,13 @@ impl TestStruct { } } -fn print_ty_name(test: Vec<&mut Box>) -> Result, EvalAltResult> { - println!("Ty name: {:?}", (*test[0]).as_ref().type_name()); - - Ok(Box::new(())) -} - fn main() { let mut engine = Engine::new(); engine.register_type::(); - print_ty_name(vec![&mut (Box::new(TestStruct::new()) as Box)]).unwrap(); - engine.register_fn("update", TestStruct::update); engine.register_fn("new_ts", TestStruct::new); - engine.register_fn_raw("ty_name".to_owned(), None, Box::new(print_ty_name)); println!( "{:?}", diff --git a/src/engine.rs b/src/engine.rs index 37fafb57..4ecda460 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -151,7 +151,6 @@ impl Engine { /// your type must implement Clone. pub fn register_type(&mut self) { // currently a no-op, exists for future extensibility - println!("Registering {:?}", TypeId::of::()); } /// Register a get function for a member of a registered type @@ -947,11 +946,7 @@ impl Engine { fns: HashMap::new(), }; - // TODO - // TODO - // TODO - // TODO - //Engine::register_default_lib(&mut engine); + Engine::register_default_lib(&mut engine); engine }