Skip to content

Commit

Permalink
chore: remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ltabis committed Mar 22, 2024
1 parent 3ad396e commit 26976f9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
54 changes: 0 additions & 54 deletions src/api/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,60 +244,6 @@ impl Engine {
self
}
/// Register a custom type for use with the [`Engine`], with a pretty-print name
/// for the `type_of` function and comments. The type must implement [`Clone`],
/// and the "metadata" feature must be enabled.
///
/// # Example
///
/// ```
/// #[derive(Clone)]
/// struct TestStruct {
/// field: i64
/// }
///
/// impl TestStruct {
/// fn new() -> Self {
/// Self { field: 1 }
/// }
/// }
///
/// # fn main() -> Result<(), Box<rhai::EvalAltResult>> {
/// use rhai::Engine;
///
/// let mut engine = Engine::new();
///
/// // Register API for the custom type.
/// engine
/// .register_type::<TestStruct>()
/// .register_fn("new_ts", TestStruct::new);
///
/// assert_eq!(
/// engine.eval::<String>("let x = new_ts(); type_of(x)")?,
/// "rust_out::TestStruct"
/// );
///
/// // Re-register the custom type with a name and comments.
/// engine.register_type_with_name_and_comments::<TestStruct>("Hello", &["A comment for this type"]);
///
/// assert_eq!(
/// engine.eval::<String>("let x = new_ts(); type_of(x)")?,
/// "Hello"
/// );
/// # Ok(())
/// # }
/// ```
#[cfg(feature = "metadata")]
#[inline(always)]
pub fn register_type_with_name_and_comments<T: Variant + Clone>(
&mut self,
name: &str,
comments: &[&str],
) -> &mut Self {
self.global_namespace_mut()
.set_custom_type_with_comments::<T>(name, comments);
self
}
/// Register a custom type for use with the [`Engine`], with a pretty-print name
/// for the `type_of` function. The type must implement [`Clone`].
///
/// # WARNING - Low Level API
Expand Down
7 changes: 0 additions & 7 deletions src/module/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,13 +550,6 @@ impl FuncRegistration {

&entry.1
}

/// Get the hash value of the function.
#[cfg(feature = "metadata")]
#[must_use]
pub fn hash(&self) -> u64 {
self.metadata.hash
}
}

bitflags! {
Expand Down

0 comments on commit 26976f9

Please sign in to comment.