From 39ab473514bbdbedfe58ce922a6d52105d9c41ad Mon Sep 17 00:00:00 2001 From: lunar-mining Date: Thu, 7 Oct 2021 17:25:08 +0200 Subject: [PATCH] drk: manually enter rows in prettytable --- src/bin/drk.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/drk.rs b/src/bin/drk.rs index 74ac133d4..15c25648c 100644 --- a/src/bin/drk.rs +++ b/src/bin/drk.rs @@ -1,5 +1,6 @@ #[macro_use] extern crate prettytable; +use prettytable::{Cell, Row, Table}; use drk::cli::{Config, DrkConfig}; use drk::util::{join_config_path, NetworkName}; @@ -173,8 +174,9 @@ async fn start(config: &DrkConfig, options: ArgMatches<'_>) -> Result<()> { if matches.is_present("balances") { let reply = client.get_balances().await?; - let _table = ptable!([reply]); - println!("Server replied: {}", &reply.to_string()); + let mut table = Table::new(); + table.add_row(row!["TOKEN", "AMOUNT"]); + table.add_row(row![reply]); return Ok(()); } }