updated main in table so that it outputs again (#3662)

This commit is contained in:
Darren Schroeder 2021-06-21 14:14:20 -05:00 committed by GitHub
parent 318d13ed58
commit 7c0a52a81e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 2 deletions

22
crates/nu-table/.gitignore vendored Normal file
View File

@ -0,0 +1,22 @@
/target
/scratch
**/*.rs.bk
history.txt
tests/fixtures/nuplayground
crates/*/target
# Debian/Ubuntu
debian/.debhelper/
debian/debhelper-build-stamp
debian/files
debian/nu.substvars
debian/nu/
# macOS junk
.DS_Store
# JetBrains' IDE items
.idea/*
# VSCode's IDE items
.vscode/*

View File

@ -23,11 +23,12 @@ fn main() {
let rows = vec_of_str_to_vec_of_styledstr(&row_data, false);
// The table itself
let table = Table::new(headers, vec![rows; 3], Theme::rounded());
// FIXME: Config isn't available from here so just put these here to compile
let color_hm: HashMap<String, nu_ansi_term::Style> = HashMap::new();
// Capture the table as a string
let output_table = draw_table(&table, width, &color_hm);
// Draw the table
draw_table(&table, width, &color_hm);
println!("{}", output_table)
}
fn make_table_data() -> (Vec<&'static str>, Vec<&'static str>) {