Skip to content

Commit

Permalink
improve code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocampos-ssa committed Jun 4, 2024
1 parent 0529fb3 commit f81ee4a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/kos-sdk/src/chains/klever/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ pub struct DataAccount {

impl std::fmt::Display for ResultAccount {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "({})", serde_json::to_string(&self).unwrap())
match serde_json::to_string(&self) {
Ok(json_str) => write!(f, "({})", json_str),
Err(e) => write!(f, "{}", e),
}
}
}

Expand Down Expand Up @@ -137,6 +140,9 @@ pub struct TransferTXRequest {

impl std::fmt::Display for TransferTXRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "({})", serde_json::to_string(&self).unwrap())
match serde_json::to_string(&self) {
Ok(json_str) => write!(f, "({})", json_str),
Err(e) => write!(f, "{}", e),
}
}
}

0 comments on commit f81ee4a

Please sign in to comment.