Add async statements
This commit is contained in:
parent
a9ef75dc12
commit
e95aa1e437
@ -43,18 +43,18 @@ impl AbstractTree for Async {
|
|||||||
statements
|
statements
|
||||||
.into_par_iter()
|
.into_par_iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.find_map_last(|(index, statement)| {
|
.find_map_first(|(index, statement)| {
|
||||||
let mut context = context.clone();
|
let mut context = context.clone();
|
||||||
let result = statement.run(source, &mut context).unwrap_or_default();
|
let result = statement.run(source, &mut context);
|
||||||
|
|
||||||
if index == statements.len() - 1 {
|
if result.is_err() {
|
||||||
|
Some(result)
|
||||||
|
} else if index == statements.len() - 1 {
|
||||||
Some(result)
|
Some(result)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.ok_or(Error::CustomMessage(
|
.unwrap()
|
||||||
"Async block has nothing to run.".to_string(),
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user