Use ImmutableString in more places.

This commit is contained in:
Stephen Chung
2022-10-29 14:59:20 +08:00
parent 8e35f98477
commit 91415b9750
11 changed files with 45 additions and 85 deletions

View File

@@ -40,7 +40,7 @@ mod debugging_functions {
.iter()
.rev()
.filter(|crate::debugger::CallStackFrame { fn_name, args, .. }| {
fn_name != "back_trace" || !args.is_empty()
fn_name.as_str() != "back_trace" || !args.is_empty()
})
.map(
|frame @ crate::debugger::CallStackFrame {

View File

@@ -27,7 +27,7 @@ mod fn_ptr_functions {
/// ```
#[rhai_fn(name = "name", get = "name", pure)]
pub fn name(fn_ptr: &mut FnPtr) -> ImmutableString {
fn_ptr.fn_name_raw().into()
fn_ptr.fn_name_raw().clone()
}
/// Return `true` if the function is an anonymous function.