Rename as_string and as_immutable_string.

This commit is contained in:
Stephen Chung
2021-07-24 16:24:59 +08:00
parent b21deaf052
commit 94674679d9
12 changed files with 67 additions and 32 deletions

View File

@@ -30,7 +30,7 @@ pub fn print_with_func(
) -> crate::ImmutableString {
match ctx.call_fn_dynamic_raw(fn_name, true, &mut [value]) {
Ok(result) if result.is::<crate::ImmutableString>() => result
.as_immutable_string()
.into_immutable_string()
.expect("never fails as the result is `ImmutableString`"),
Ok(result) => ctx.engine().map_type_name(result.type_name()).into(),
Err(_) => ctx.engine().map_type_name(value.type_name()).into(),