Simplify formatting.

This commit is contained in:
Stephen Chung
2022-03-14 08:50:17 +08:00
parent a704d26986
commit 672cda63ab
7 changed files with 53 additions and 93 deletions

View File

@@ -195,12 +195,8 @@ impl Engine {
let typ = self.map_type_name(result.type_name());
result.try_cast::<T>().ok_or_else(|| {
ERR::ErrorMismatchOutputType(
self.map_type_name(type_name::<T>()).into(),
typ.into(),
Position::NONE,
)
.into()
let t = self.map_type_name(type_name::<T>()).into();
ERR::ErrorMismatchOutputType(t, typ.into(), Position::NONE).into()
})
}
/// Evaluate an [`AST`] with own scope.