Skip to content

Commit 7f5528c

Browse files
committed
remove unused parameters in table function calls
1 parent 7e35848 commit 7f5528c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/table.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn term_width() -> usize {
1111
.unwrap_or(120)
1212
}
1313

14-
fn style_table(table: &mut tabled::Table, _ncols: usize) {
14+
fn style_table(table: &mut tabled::Table) {
1515
let tw = term_width();
1616

1717
table
@@ -23,22 +23,20 @@ fn style_table(table: &mut tabled::Table, _ncols: usize) {
2323

2424
/// Print a table with string data. Headers are &str slices, rows are Vec<String>.
2525
pub fn print(headers: &[&str], rows: &[Vec<String>]) {
26-
let ncols = headers.len();
2726
let mut builder = tabled::builder::Builder::new();
2827
builder.push_record(headers.iter().map(|h| h.to_string()));
2928
for row in rows {
3029
builder.push_record(row.iter().map(|c| c.to_string()));
3130
}
3231
let mut table = builder.build();
33-
style_table(&mut table, ncols);
32+
style_table(&mut table);
3433
println!("{table}");
3534
}
3635

3736
/// Print a table with JSON-typed data. Numbers, bools, and nulls get per-cell coloring.
3837
pub fn print_json(headers: &[String], rows: &[Vec<serde_json::Value>]) {
3938
use tabled::settings::object::Cell;
4039

41-
let ncols = headers.len();
4240
let mut builder = tabled::builder::Builder::new();
4341
builder.push_record(headers.iter().map(|h| h.to_string()));
4442

@@ -71,7 +69,7 @@ pub fn print_json(headers: &[String], rows: &[Vec<serde_json::Value>]) {
7169
}
7270

7371
let mut table = builder.build();
74-
style_table(&mut table, ncols);
72+
style_table(&mut table);
7573

7674
for (r, c, color) in colored_cells {
7775
table.with(Modify::new(Cell::new(r, c)).with(color));

0 commit comments

Comments
 (0)