Improve docs.

This commit is contained in:
Stephen Chung
2022-08-24 18:27:58 +08:00
parent 010a96dde3
commit b40ca9e40d
6 changed files with 70 additions and 76 deletions

View File

@@ -143,11 +143,11 @@ impl Engine {
/// This method will be removed in the next major version.
#[deprecated(since = "1.9.1", note = "use `register_fn` instead")]
#[inline(always)]
pub fn register_result_fn<N, A, F, R, S>(&mut self, name: N, func: F) -> &mut Self
where
N: AsRef<str> + Into<Identifier>,
F: RegisterNativeFunction<A, R, RhaiResultOf<S>>,
{
pub fn register_result_fn<A, R, S>(
&mut self,
name: impl AsRef<str> + Into<Identifier>,
func: impl RegisterNativeFunction<A, R, RhaiResultOf<S>>,
) -> &mut Self {
self.register_fn(name, func)
}
/// Register a getter function for a member of a registered type with the [`Engine`].