From 3224c5baf58733babf6fe18b1f689d0924e29a98 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Tue, 22 Sep 2020 19:42:44 +0800 Subject: [PATCH] Avoid &mut ImmutableString. --- src/packages/string_more.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/packages/string_more.rs b/src/packages/string_more.rs index 413e78a2..218f2dd8 100644 --- a/src/packages/string_more.rs +++ b/src/packages/string_more.rs @@ -24,13 +24,13 @@ macro_rules! gen_concat_functions { pub mod functions { #[rhai_fn(name = "+")] #[inline] - pub fn append_func(x: &mut ImmutableString, y: $arg_type) -> String { + pub fn append_func(x: &str, y: $arg_type) -> String { format!("{}{}", x, y) } #[rhai_fn(name = "+")] #[inline] - pub fn prepend_func(x: &mut $arg_type, y: ImmutableString) -> String { + pub fn prepend_func(x: &mut $arg_type, y: &str) -> String { format!("{}{}", x, y) } } @@ -40,7 +40,7 @@ macro_rules! gen_concat_functions { macro_rules! reg_functions { ($mod_name:ident += $root:ident ; $($arg_type:ident),+) => { $( - combine_with_exported_module!($mod_name, "append", $root::$arg_type::functions); + combine_with_exported_module!($mod_name, "strings_merge", $root::$arg_type::functions); )* } }