Move some concat functions to builtin.
This commit is contained in:
@@ -43,7 +43,7 @@ macro_rules! reg_functions {
|
||||
}
|
||||
|
||||
def_package!(crate:MoreStringPackage:"Additional string utilities, including string building.", lib, {
|
||||
reg_functions!(lib += basic; INT, bool, char, FnPtr);
|
||||
reg_functions!(lib += basic; INT, bool, FnPtr);
|
||||
|
||||
#[cfg(not(feature = "only_i32"))]
|
||||
#[cfg(not(feature = "only_i64"))]
|
||||
@@ -139,15 +139,6 @@ mod string_functions {
|
||||
s
|
||||
}
|
||||
|
||||
#[rhai_fn(name = "+=")]
|
||||
pub fn append_char(s: &mut ImmutableString, ch: char) {
|
||||
*s += ch;
|
||||
}
|
||||
#[rhai_fn(name = "+=")]
|
||||
pub fn append_string(s: &mut ImmutableString, add: ImmutableString) {
|
||||
*s += &add;
|
||||
}
|
||||
|
||||
#[rhai_fn(name = "len", get = "len")]
|
||||
pub fn len(s: &str) -> INT {
|
||||
s.chars().count() as INT
|
||||
|
Reference in New Issue
Block a user