Skip to content

Commit 202c418

Browse files
committed
fix: rmeoved outdated code
1 parent b46cb5d commit 202c418

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

cli/src/table.rs

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
use code0_definition_reader::parser::DefinitionError;
22
use code0_definition_reader::parser::Feature;
33
use colored::*;
4-
use tabled::{
5-
Table, Tabled,
6-
settings::{Modify, Style, Width, object::Columns},
7-
};
4+
use tabled::{Table, Tabled, settings::Style};
85
use tucana::shared::{DefinitionDataType, FlowType, RuntimeFunctionDefinition};
96

107
#[derive(Tabled)]
@@ -207,13 +204,7 @@ pub fn feature_table(feature: &Feature) {
207204
)
208205
.collect();
209206

210-
let table = Table::new(error_rows)
211-
.with(Style::rounded())
212-
.with(Modify::new(Columns::single(0)).with(Width::wrap(5))) // Index column
213-
.with(Modify::new(Columns::single(1)).with(Width::wrap(15))) // Type column
214-
.with(Modify::new(Columns::single(2)).with(Width::wrap(20))) // Definition column
215-
.with(Modify::new(Columns::single(3)).with(Width::wrap(40))) // Error column
216-
.to_string();
207+
let table = Table::new(error_rows).with(Style::rounded()).to_string();
217208
println!("{}", table.bright_red());
218209
} else {
219210
println!("{}", " No errors found!".bright_green());
@@ -275,13 +266,10 @@ pub fn error_table(features: &Vec<Feature>) {
275266

276267
let table = Table::new(error_rows)
277268
.with(Style::rounded())
278-
.with(Modify::new(Columns::single(0)).with(Width::wrap(5))) // Index column
279-
.with(Modify::new(Columns::single(1)).with(Width::wrap(15))) // Feature column
280-
.with(Modify::new(Columns::single(2)).with(Width::wrap(12))) // Type column
281-
.with(Modify::new(Columns::single(3)).with(Width::wrap(18))) // Definition column
282-
.with(Modify::new(Columns::single(4)).with(Width::wrap(35))) // Error column
283-
.to_string();
284-
println!("{}", table.bright_red());
269+
.to_string()
270+
.bright_red();
271+
272+
println!("{table}");
285273
} else {
286274
println!(
287275
"{}",
@@ -331,15 +319,7 @@ pub fn summary_table(features: &[Feature]) {
331319
.collect();
332320

333321
if !summary_rows.is_empty() {
334-
let table = Table::new(summary_rows)
335-
.with(Style::rounded())
336-
.with(Modify::new(Columns::single(0)).with(Width::wrap(20))) // Feature name
337-
.with(Modify::new(Columns::single(1)).with(Width::wrap(12))) // Status
338-
.with(Modify::new(Columns::single(2)).with(Width::wrap(8))) // Errors
339-
.with(Modify::new(Columns::single(3)).with(Width::wrap(12))) // Flow Types
340-
.with(Modify::new(Columns::single(4)).with(Width::wrap(12))) // Data Types
341-
.with(Modify::new(Columns::single(5)).with(Width::wrap(18))) // Runtime Functions
342-
.to_string();
322+
let table = Table::new(summary_rows).with(Style::rounded()).to_string();
343323

344324
println!("{}", table.bright_blue());
345325
}

0 commit comments

Comments
 (0)