@@ -14,7 +14,7 @@ use clap::{App, Shell};
1414use gitjournal:: GitJournal ;
1515use gitjournal:: errors:: * ;
1616
17- fn error_and_exit ( string : & str , error : Error ) {
17+ fn error_and_exit ( string : & str , error : & Error ) {
1818 error ! ( "{}: {}" , string, error) ;
1919 exit ( 1 ) ;
2020}
@@ -33,7 +33,7 @@ fn is_program_in_path(program: &str) -> bool {
3333
3434fn main ( ) {
3535 if let Err ( error) = run ( ) {
36- error_and_exit ( "Main" , error) ;
36+ error_and_exit ( "Main" , & error) ;
3737 }
3838}
3939
@@ -55,7 +55,7 @@ fn run() -> Result<()> {
5555 match journal. prepare ( sub_matches. value_of ( "message" ) . ok_or_else ( || "No CLI 'message' provided" ) ?,
5656 sub_matches. value_of ( "type" ) ) {
5757 Ok ( ( ) ) => info ! ( "Commit message prepared." ) ,
58- Err ( error) => error_and_exit ( "Commit message preparation failed" , error) ,
58+ Err ( error) => error_and_exit ( "Commit message preparation failed" , & error) ,
5959 }
6060 }
6161 }
@@ -82,7 +82,7 @@ fn run() -> Result<()> {
8282 if let Some ( sub_matches) = matches. subcommand_matches ( "verify" ) {
8383 match journal. verify ( sub_matches. value_of ( "message" ) . ok_or_else ( || "No CLI 'message' provided" ) ?) {
8484 Ok ( ( ) ) => info ! ( "Commit message valid." ) ,
85- Err ( error) => error_and_exit ( "Commit message invalid" , error) ,
85+ Err ( error) => error_and_exit ( "Commit message invalid" , & error) ,
8686 }
8787 }
8888 }
@@ -100,7 +100,7 @@ fn run() -> Result<()> {
100100 & max_tags,
101101 & matches. is_present ( "all" ) ,
102102 & matches. is_present ( "skip_unreleased" ) ) {
103- error_and_exit ( "Log parsing error" , error) ;
103+ error_and_exit ( "Log parsing error" , & error) ;
104104 }
105105
106106 // Generate the template or print the log
0 commit comments