Deprecate FnPtr::num_curried.

This commit is contained in:
Stephen Chung
2022-05-05 22:30:55 +08:00
parent b23d64bec0
commit fc64e93b93
3 changed files with 20 additions and 8 deletions

View File

@@ -259,6 +259,19 @@ impl<T> From<EvalAltResult> for RhaiResultOf<T> {
}
impl FnPtr {
/// Get the number of curried arguments.
///
/// # Deprecated
///
/// This method is deprecated. Use [`curry().len()`][`FnPtr::curry`] instead.
///
/// This method will be removed in the next major version.
#[deprecated(since = "1.8.0", note = "use `curry().len()` instead")]
#[inline(always)]
#[must_use]
pub fn num_curried(&self) -> usize {
self.curry().len()
}
/// Call the function pointer with curried arguments (if any).
/// The function may be script-defined (not available under `no_function`) or native Rust.
///