mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
775 B
31 lines
775 B
use display_table::*; |
|
|
|
fn main() { |
|
let mut table = Table::new(); |
|
println!("{}", table); |
|
table.headers = vec![ |
|
String::from("Model"), |
|
String::from("Piece N°"), |
|
String::from("In Stock"), |
|
String::from("Description"), |
|
]; |
|
table.add_row(&[ |
|
String::from("model 1"), |
|
String::from("43-EWQE304"), |
|
String::from("30"), |
|
String::from("Piece for x"), |
|
]); |
|
table.add_row(&[ |
|
String::from("model 2"), |
|
String::from("98-QCVX5433"), |
|
String::from("100000000"), |
|
String::from("-"), |
|
]); |
|
table.add_row(&[ |
|
String::from("model y"), |
|
String::from("78-NMNH"), |
|
String::from("60"), |
|
String::from("nothing"), |
|
]); |
|
println!("{}", table); |
|
}
|
|
|