Skip to content

Commit

Permalink
rust format
Browse files Browse the repository at this point in the history
  • Loading branch information
rlkelly committed May 1, 2018
1 parent 00cc982 commit b91d816
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/accountant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl Accountant {
return match result {
Ok(_) => Ok(()),
Err(_) => Err(AccountingError::BalanceUpdatedBeforeTransactionCompleted),
}
};
}

pub fn process_verified_transaction_credits(&self, tr: &Transaction) {
Expand All @@ -181,10 +181,8 @@ impl Accountant {
Ok(_) => {
self.process_verified_transaction_credits(tr);
Ok(())
},
Err(err) => {
Err(err)
}
Err(err) => Err(err),
};
}

Expand Down
9 changes: 6 additions & 3 deletions src/accountant_skel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit b91d816

Please sign in to comment.