Refine expect messages.

This commit is contained in:
Stephen Chung
2021-08-26 23:58:41 +08:00
parent 2a760eb44b
commit aec4417bd5
21 changed files with 328 additions and 334 deletions

View File

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