rust format

This commit is contained in:
Robert Kelly 2018-05-01 16:38:08 -04:00
parent ccb478c1f6
commit cb362e9052
2 changed files with 8 additions and 7 deletions

View File

@ -160,7 +160,7 @@ impl Accountant {
return match result {
Ok(_) => Ok(()),
Err(_) => Err(AccountingError::BalanceUpdatedBeforeTransactionCompleted),
}
};
}
pub fn process_verified_transaction_credits(&self, tr: &Transaction) {
@ -181,10 +181,8 @@ impl Accountant {
Ok(_) => {
self.process_verified_transaction_credits(tr);
Ok(())
},
Err(err) => {
Err(err)
}
Err(err) => Err(err),
};
}

View File

@ -777,8 +777,8 @@ mod bench {
let tr = Transaction::new(&mint.keypair(), rando0.pubkey(), 1_000, last_id);
// some of these will fail because balance updates before transaction completes
match acc.process_verified_transaction(&tr) {
Ok(_) => (),
Err(_) => *errors.lock().unwrap() += 1,
Ok(_) => (),
Err(_) => *errors.lock().unwrap() += 1,
};
let rando1 = KeyPair::new();
@ -810,7 +810,10 @@ mod bench {
drop(skel.historian.sender);
let entries: Vec<Entry> = skel.historian.receiver.iter().collect();
assert_eq!(entries.len(), 1);
assert_eq!(entries[0].events.len() + *errors.lock().unwrap(), txs as usize);
assert_eq!(
entries[0].events.len() + *errors.lock().unwrap(),
txs as usize
);
println!("{} tps", tps);
}