@@ -2,7 +2,7 @@ use std::fs;
22use std:: io;
33use std:: path:: PathBuf ;
44
5- use log:: { error, info, warn} ;
5+ use log:: { debug , error, info, warn} ;
66
77use crate :: module:: Module ;
88use crate :: Options ;
@@ -14,6 +14,8 @@ impl Module {
1414 let full_path_buf: PathBuf = [ & options. target_dir , & self . file_name ] . iter ( ) . collect ( ) ;
1515 let full_path = full_path_buf. as_path ( ) ;
1616
17+ debug ! ( "Writing file: {}" , & full_path. display( ) ) ;
18+
1719 // If the target file already exists, just print out an error
1820 if full_path. exists ( ) {
1921 // A prompt enabling the user to overwrite the existing file
@@ -24,7 +26,7 @@ impl Module {
2426
2527 io:: stdin ( )
2628 . read_line ( & mut answer)
27- . expect ( "Failed to read the response" ) ;
29+ . expect ( "Failed to read your response" ) ;
2830
2931 match answer. trim ( ) . to_lowercase ( ) . as_str ( ) {
3032 "y" | "yes" => {
@@ -49,7 +51,7 @@ impl Module {
4951 }
5052 // If the write fails, print why it failed
5153 Err ( e) => {
52- error ! ( "Failed to write the file: {}" , e) ;
54+ error ! ( "Failed to write the `{}` file: {}" , & full_path . display ( ) , e) ;
5355 }
5456 }
5557 }
0 commit comments