Engine::register_type_XXX available under no_object.

This commit is contained in:
Stephen Chung 2021-08-23 23:10:54 +08:00
parent 33d1006d28
commit db3049e574
2 changed files with 1 additions and 6 deletions

View File

@ -25,6 +25,7 @@ Enhancements
* `Scope::set_value` now takes anything that implements `Into<Cow<str>>`. * `Scope::set_value` now takes anything that implements `Into<Cow<str>>`.
* Added `Scope::is_constant` to check if a variable is constant. * Added `Scope::is_constant` to check if a variable is constant.
* Added `Scope::set_or_push` to add a new variable only if one doesn't already exist. * Added `Scope::set_or_push` to add a new variable only if one doesn't already exist.
* `Engine::register_type_XXX` are now available even under `no_object`.
Version 1.0.2 Version 1.0.2

View File

@ -184,8 +184,6 @@ impl Engine {
/// Register a custom type for use with the [`Engine`]. /// Register a custom type for use with the [`Engine`].
/// The type must implement [`Clone`]. /// The type must implement [`Clone`].
/// ///
/// Not available under `no_object`.
///
/// # Example /// # Example
/// ///
/// ``` /// ```
@ -219,7 +217,6 @@ impl Engine {
/// # Ok(()) /// # Ok(())
/// # } /// # }
/// ``` /// ```
#[cfg(not(feature = "no_object"))]
#[inline(always)] #[inline(always)]
pub fn register_type<T: Variant + Clone>(&mut self) -> &mut Self { pub fn register_type<T: Variant + Clone>(&mut self) -> &mut Self {
self.register_type_with_name::<T>(type_name::<T>()) self.register_type_with_name::<T>(type_name::<T>())
@ -227,8 +224,6 @@ impl Engine {
/// Register a custom type for use with the [`Engine`], with a pretty-print name /// Register a custom type for use with the [`Engine`], with a pretty-print name
/// for the `type_of` function. The type must implement [`Clone`]. /// for the `type_of` function. The type must implement [`Clone`].
/// ///
/// Not available under `no_object`.
///
/// # Example /// # Example
/// ///
/// ``` /// ```
@ -266,7 +261,6 @@ impl Engine {
/// # Ok(()) /// # Ok(())
/// # } /// # }
/// ``` /// ```
#[cfg(not(feature = "no_object"))]
#[inline(always)] #[inline(always)]
pub fn register_type_with_name<T: Variant + Clone>(&mut self, name: &str) -> &mut Self { pub fn register_type_with_name<T: Variant + Clone>(&mut self, name: &str) -> &mut Self {
// Add the pretty-print type name into the map // Add the pretty-print type name into the map