Count compute units even when transaction errors (#22059)

This commit is contained in:
carllin
2021-12-28 17:05:11 -05:00
committed by GitHub
parent f061059e45
commit eaa8c67bde
13 changed files with 295 additions and 97 deletions

View File

@ -102,10 +102,10 @@ thread_local!(static PAR_THREAD_POOL: RefCell<ThreadPool> = RefCell::new(rayon::
.unwrap())
);
fn first_err(results: &[Result<()>]) -> Result<()> {
fn first_err<T>(results: &[Result<T>]) -> Result<()> {
for r in results {
if r.is_err() {
return r.clone();
if let Err(e) = r {
return Err(e.clone());
}
}
Ok(())