Avoid cloning in array methods as much as possible.

This commit is contained in:
Stephen Chung
2021-10-19 19:57:15 +08:00
parent 9d1ab2c8a1
commit 2334cd8f56
7 changed files with 296 additions and 192 deletions

View File

@@ -28,7 +28,7 @@ pub fn print_with_func(
ctx: &NativeCallContext,
value: &mut Dynamic,
) -> crate::ImmutableString {
match ctx.call_fn_dynamic_raw(fn_name, true, &mut [value]) {
match ctx.call_fn_raw(fn_name, true, false, &mut [value]) {
Ok(result) if result.is::<crate::ImmutableString>() => result
.into_immutable_string()
.expect("result is `ImmutableString`"),