Skip to content

Commit

Permalink
Refactor: Remove unnecessary to_string and redundant if-else block
Browse files Browse the repository at this point in the history
  • Loading branch information
stom authored and stom committed Nov 12, 2024
1 parent a4f1669 commit 513934a
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn display_json(value: &Value, title: &str) {

let main_table = Table::new(&rows)
.with(Style::rounded())
.with(Panel::header(title.to_string()))
.with(Panel::header(title))
.with(Disable::row(Rows::single(1)))
.to_string();

Expand Down Expand Up @@ -132,12 +132,7 @@ fn display_events(events: &Value) {
continue;
}

if key == "decoded_event_data" && value.is_object() {
event_rows.push(TableRow {
line: format!("[{}]", key),
});
event_rows.extend(format_nested_json(value));
} else if value.is_object() {
if value.is_object() {
event_rows.push(TableRow {
line: format!("[{}]", key),
});
Expand Down

0 comments on commit 513934a

Please sign in to comment.