style: code style

This commit is contained in:
2021-01-01 23:42:15 +08:00
parent eb1be1caf2
commit 695561da70
7 changed files with 59 additions and 19 deletions

View File

@@ -32,7 +32,13 @@ impl CreditContract {
return simple_error!("Cannot issue 0 credit!");
}
if self.issue_amount + credit > self.credit_limit {
return simple_error!("Issue too much credit, current: {}, issue: {}, limit: {}, left: {}", self.issue_amount, credit, self.credit_limit, self.credit_limit - self.issue_amount);
return simple_error!(
"Issue too much credit, current: {}, issue: {}, limit: {}, left: {}",
self.issue_amount,
credit,
self.credit_limit,
self.credit_limit - self.issue_amount
);
}
match self.credit.get_mut(receiver) {
None => { self.credit.insert(receiver.to_owned(), credit); },