Replace unwrap with expect.
This commit is contained in:
@@ -27,9 +27,9 @@ pub fn print_with_func(
|
||||
value: &mut Dynamic,
|
||||
) -> crate::ImmutableString {
|
||||
match ctx.call_fn_dynamic_raw(fn_name, true, &mut [value]) {
|
||||
Ok(result) if result.is::<crate::ImmutableString>() => {
|
||||
result.take_immutable_string().unwrap()
|
||||
}
|
||||
Ok(result) if result.is::<crate::ImmutableString>() => result
|
||||
.take_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(),
|
||||
}
|
||||
|
Reference in New Issue
Block a user