Skip to content

Commit

Permalink
[fix] pretty print
Browse files Browse the repository at this point in the history
Signed-off-by: Chojan Shang <[email protected]>
  • Loading branch information
PsiACE committed Aug 6, 2021
1 parent 2438902 commit 36c5c61
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion common/datablocks/src/data_block_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::DataBlock;

///! Create a visual representation of record batches
pub fn pretty_format_blocks(results: &[DataBlock]) -> Result<String> {
Ok(create_table(results)?.to_string())
Ok(create_table(results)?.trim_fmt())
}

pub fn assert_blocks_eq(expect: Vec<&str>, blocks: &[DataBlock]) {
Expand Down
2 changes: 1 addition & 1 deletion common/datavalues/src/series/series_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::Series;

///! Create a visual representation of record batches
pub fn pretty_format_series(results: &[Series]) -> Result<String> {
Ok(create_table(results)?.to_string())
Ok(create_table(results)?.trim_fmt())
}

pub fn assert_series_eq(expect: Vec<&str>, series: &[Series]) {
Expand Down
13 changes: 7 additions & 6 deletions fusecli/cli/src/cmds/packages/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use std::fs;

use colored::Colorize;
use comfy_table::Cell;
use comfy_table::CellAlignment;
use comfy_table::Color;
use comfy_table::Table;

use crate::cmds::Config;
Expand Down Expand Up @@ -51,16 +52,16 @@ impl ListCommand {
.into_owned();
let mut row = vec![];
row.push(Cell::new(version.as_str()));
row.push(Cell::new(format!("{}", path.path().display(),).as_str()));
row.push(Cell::new(format!("{}", path.path().display(),)));

let mut current_marker = "".to_string();
let mut current_marker = Cell::new("");
if current == version {
current_marker = format!("{}", "✅ ".blue());
current_marker = Cell::new("☑").fg(Color::Green);
}
row.push(Cell::new(current_marker.as_str()));
row.push(current_marker.set_alignment(CellAlignment::Center));
table.add_row(row);
}
writer.writeln(&table.to_string());
writer.writeln(&table.trim_fmt());

Ok(())
}
Expand Down

0 comments on commit 36c5c61

Please sign in to comment.