From 26bb88974a111f7518ace6eb7c02f156ee44091d Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Mon, 5 Apr 2021 00:10:08 +0800 Subject: [PATCH] Add function for string + char. --- src/packages/string_more.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/packages/string_more.rs b/src/packages/string_more.rs index e2e533e3..109549fd 100644 --- a/src/packages/string_more.rs +++ b/src/packages/string_more.rs @@ -56,6 +56,10 @@ mod string_functions { pub fn add_append_str(string1: ImmutableString, string2: ImmutableString) -> ImmutableString { string1 + string2 } + #[rhai_fn(name = "+", name = "append")] + pub fn add_append_char(string: ImmutableString, ch: char) -> ImmutableString { + string + ch + } #[rhai_fn(name = "+", name = "append")] pub fn add_append_unit(string: ImmutableString, _item: ()) -> ImmutableString {