Improve string parameters.

This commit is contained in:
Stephen Chung
2022-02-24 13:39:10 +08:00
parent 39ef766bf1
commit d2ad56e279
3 changed files with 81 additions and 31 deletions

View File

@@ -241,7 +241,7 @@ pub mod blob_functions {
/// print(b); // prints "[424242424268656c 6c6f]"
/// ```
#[rhai_fn(name = "+=", name = "append")]
pub fn append_str(blob: &mut Blob, string: ImmutableString) {
pub fn append_str(blob: &mut Blob, string: &str) {
if !string.is_empty() {
blob.extend(string.as_bytes());
}