File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,16 @@ mod util;
33use cli:: { CompletionOpt , Opt , StructOpt , Subcommand } ;
44use std:: fs:: File ;
55use std:: io:: { self , BufRead , BufReader } ;
6+ use std:: process;
67
7- fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
8+ fn main ( ) {
9+ if let Err ( e) = run ( ) {
10+ eprintln ! ( "{}: {}" , env!( "CARGO_PKG_NAME" ) , e) ;
11+ process:: exit ( 1 )
12+ }
13+ }
14+
15+ fn run ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
816 util:: reset_signal_pipe_handler ( ) ;
917 let opt: Opt = Opt :: from_args ( ) ;
1018 match & opt. subcommand {
@@ -16,7 +24,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
1624 Some ( path) => Box :: new ( BufReader :: new ( File :: open ( path) ?) ) ,
1725 None => Box :: new ( BufReader :: new ( io:: stdin ( ) ) ) ,
1826 } ;
19- code_minimap:: print ( reader, opt. hscale , opt. vscale , opt. padding ) . unwrap ( ) ;
27+ code_minimap:: print ( reader, opt. hscale , opt. vscale , opt. padding ) ? ;
2028 }
2129 }
2230 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments