Skip to content

Commit

Permalink
only call function once
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph committed Jan 30, 2024
1 parent 425748a commit 684927a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,14 +693,13 @@ impl Server {
AcceptJson(accept_json): AcceptJson,
) -> ServerResult<Response> {
task::block_in_place(|| {
let runes_balances = index.get_rune_balance_map()?;
Ok(if accept_json {
Json(index.get_rune_balance_map()?).into_response()
Json(runes_balances).into_response()
} else {
RunesBalancesHtml {
runes_balances: index.get_rune_balance_map()?,
}
.page(server_config)
.into_response()
RunesBalancesHtml { runes_balances }
.page(server_config)
.into_response()
})
})
}
Expand Down

0 comments on commit 684927a

Please sign in to comment.