File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,13 +85,13 @@ fn format_pretty(data: &Vec<Vec<String>>) -> String {
8585 ] . join ( "\n " )
8686}
8787
88- fn main ( ) -> Result < ( ) > {
88+ fn main ( ) {
8989 let config = Config :: from_args ( ) ;
90- let lines = read_lines ( & config. file ) ? ;
90+ let lines = read_lines ( & config. file ) . expect ( "Error when reading input" ) ;
9191 let data = parse_table_data ( & lines, & config. separator ) ;
9292
9393 if data. len ( ) < 2 || data[ 0 ] . len ( ) == 0 {
94- eprintln ! ( "Bad Input: Table requires at least 2 rows (including header) and 1 column." ) ;
94+ eprintln ! ( "Bad Input: Requires at least 2 rows (including header) and 1 column." ) ;
9595 std:: process:: exit ( 1 ) ;
9696 }
9797
@@ -100,8 +100,7 @@ fn main() -> Result<()> {
100100 false => format_pretty ( & data) ,
101101 } + "\n " ;
102102 match config. out {
103- Some ( f) => fs:: write ( f, & table) ? ,
103+ Some ( f) => fs:: write ( f, & table) . expect ( "Error when writing output to file" ) ,
104104 None => print ! ( "{}" , & table) ,
105105 } ;
106- Ok ( ( ) )
107106}
You can’t perform that action at this time.
0 commit comments