Change Dynamic::from_xxx to From<xxx> impl.

This commit is contained in:
Stephen Chung
2020-04-22 12:12:13 +08:00
parent 69733688bf
commit c69647d9fd
5 changed files with 79 additions and 98 deletions

View File

@@ -803,7 +803,7 @@ impl Engine {
) -> Result<Dynamic, Box<EvalAltResult>> {
ast.0
.iter()
.try_fold(Dynamic::from_unit(), |_, stmt| {
.try_fold(().into(), |_, stmt| {
self.eval_stmt(scope, Some(ast.1.as_ref()), stmt, 0)
})
.or_else(|err| match *err {
@@ -866,7 +866,7 @@ impl Engine {
) -> Result<(), Box<EvalAltResult>> {
ast.0
.iter()
.try_fold(Dynamic::from_unit(), |_, stmt| {
.try_fold(().into(), |_, stmt| {
self.eval_stmt(scope, Some(ast.1.as_ref()), stmt, 0)
})
.map_or_else(