Make FnPtr::fn_name_raw const.

This commit is contained in:
Stephen Chung
2021-06-29 21:47:27 +08:00
parent 0346bb874b
commit d146de4ff9
4 changed files with 18 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ def_package!(crate:BasicFnPackage:"Basic Fn functions.", lib, {
mod fn_ptr_functions {
#[rhai_fn(name = "name", get = "name", pure)]
pub fn name(f: &mut FnPtr) -> ImmutableString {
f.get_fn_name().as_str().into()
f.fn_name_raw().into()
}
#[cfg(not(feature = "no_function"))]