This commit is contained in:
Stephen Chung
2022-08-09 16:59:53 +08:00
3 changed files with 81 additions and 19 deletions

View File

@@ -38,8 +38,7 @@ use crate::{
/// builder
/// .with_name("TestStruct")
/// .with_fn("new_ts", Self::new)
/// .with_fn("update", Self::update)
/// .with_get_set("value", Self::get_value, Self::set_value);
/// .with_fn("update", Self::update);
/// }
/// }
///
@@ -56,12 +55,6 @@ use crate::{
/// engine.eval::<TestStruct>("let x = new_ts(); x.update(41); x")?,
/// TestStruct { field: 42 }
/// );
///
/// # #[cfg(not(feature = "no_object"))]
/// assert_eq!(
/// engine.eval::<TestStruct>("let x = new_ts(); x.value = 5 + x.value; x")?,
/// TestStruct { field: 6 }
/// );
/// # Ok(())
/// # }
/// ```
@@ -76,7 +69,6 @@ impl Engine {
/// i.e. register the type and its getters, setters, methods, etc...
///
/// See [`CustomType`].
#[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."]
#[inline]
pub fn build_type<T>(&mut self) -> &mut Self
where