@@ -44,7 +44,7 @@ impl CodeFile {
4444 eprintln ! ( "No code file found! Try creating a file named with proper extension" , ) ;
4545 std:: process:: exit ( 1 ) ;
4646 } ) ;
47- let Ok ( code) = std:: fs:: read_to_string ( & code_file. path ) else {
47+ let Ok ( code) = std:: fs:: read_to_string ( & code_file. path ) else {
4848 eprintln ! ( "Error reading the code file!" ) ;
4949 std:: process:: exit ( 1 ) ;
5050 } ;
@@ -65,14 +65,14 @@ impl CodeFile {
6565 let language = Language :: from_str ( extension) ?;
6666
6767 Some ( (
68- file_name,
69- CodeFile {
70- language,
71- path : path. clone ( ) ,
72- question_title : String :: new ( ) ,
73- code : String :: new ( ) ,
74- } ,
75- ) )
68+ file_name,
69+ CodeFile {
70+ language,
71+ path : path. clone ( ) ,
72+ question_title : String :: new ( ) ,
73+ code : String :: new ( ) ,
74+ } ,
75+ ) )
7676 }
7777
7878 fn parse_code ( code : & str , language : Language ) -> Result < ( String , String ) , & str > {
@@ -95,15 +95,17 @@ impl CodeFile {
9595 return Err ( "No leetcode problem found in the code file. Please add the problem link in the code file using comments." ) ;
9696 }
9797 let code = code[ start..end] . trim ( ) ;
98- let code = code. trim_end_matches ( language. inline_comment_start ( ) ) . trim_end ( ) ;
98+ let code = code
99+ . trim_end_matches ( language. inline_comment_start ( ) )
100+ . trim_end ( ) ;
99101 parsed_code = code. to_string ( ) ;
100102
101103 Ok ( ( question_title, parsed_code) )
102104 }
103105
104106 pub fn from_file ( path : & str ) -> Self {
105107 let path = PathBuf :: from ( & path) ;
106- let Some ( file) = Self :: is_valid_file ( & path) else {
108+ let Some ( file) = Self :: is_valid_file ( & path) else {
107109 eprintln ! ( "Invalid file!" ) ;
108110 std:: process:: exit ( 1 ) ;
109111 } ;
0 commit comments