style: credit contract style
This commit is contained in:
@@ -25,10 +25,6 @@ impl CreditContract {
|
||||
Ok(c)
|
||||
}
|
||||
|
||||
pub fn load(name: &str) -> XResult<Self> {
|
||||
load_credit_contract(name)
|
||||
}
|
||||
|
||||
pub fn issue(&mut self, tx: &Transaction, receiver: &str, credit: u32) -> XResult<()> {
|
||||
if &self.admin != &tx.sender {
|
||||
return simple_error!("Current user is not admin, {} vs {:?}", self.admin, tx.sender);
|
||||
@@ -82,7 +78,9 @@ impl CreditContract {
|
||||
}
|
||||
}
|
||||
|
||||
fn load_credit_contract(name: &str) -> XResult<CreditContract> {
|
||||
|
||||
// ========================================================================= //
|
||||
pub fn load_credit_contract(name: &str) -> XResult<CreditContract> {
|
||||
let json = fs::read_to_string(name)?;
|
||||
serde_json::from_str(&json).map_err(|e| e.into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user