@@ -99,7 +99,7 @@ impl Compiler {
9999 let mut lexer = Lexer :: new ( source) ;
100100 let tokens = lexer
101101 . tokenize ( )
102- . map_err ( |e| NagariError :: LexError ( format ! ( "Lexing failed: {}" , e ) ) ) ?;
102+ . map_err ( |e| NagariError :: LexError ( format ! ( "Lexing failed: {e}" ) ) ) ?;
103103
104104 if self . config . verbose {
105105 println ! ( "✅ Lexical analysis completed ({} tokens)" , tokens. len( ) ) ;
@@ -109,7 +109,7 @@ impl Compiler {
109109 let mut parser = NagParser :: new ( tokens) ;
110110 let ast = parser
111111 . parse ( )
112- . map_err ( |e| NagariError :: ParseError ( format ! ( "Parsing failed: {}" , e ) ) ) ?;
112+ . map_err ( |e| NagariError :: ParseError ( format ! ( "Parsing failed: {e}" ) ) ) ?;
113113
114114 if self . config . verbose {
115115 println ! ( "✅ Parsing completed" ) ;
@@ -157,7 +157,7 @@ impl Compiler {
157157 }
158158
159159 let source = fs:: read_to_string ( input_path)
160- . map_err ( |e| NagariError :: IoError ( format ! ( "Failed to read input file: {}" , e ) ) ) ?;
160+ . map_err ( |e| NagariError :: IoError ( format ! ( "Failed to read input file: {e}" ) ) ) ?;
161161
162162 let filename = input_path
163163 . file_name ( )
@@ -182,19 +182,19 @@ impl Compiler {
182182 }
183183
184184 let source = fs:: read_to_string ( input_path)
185- . map_err ( |e| NagariError :: IoError ( format ! ( "Failed to read input file: {}" , e ) ) ) ?;
185+ . map_err ( |e| NagariError :: IoError ( format ! ( "Failed to read input file: {e}" ) ) ) ?;
186186
187187 // Lexical analysis
188188 let mut lexer = Lexer :: new ( & source) ;
189189 let tokens = lexer
190190 . tokenize ( )
191- . map_err ( |e| NagariError :: LexError ( format ! ( "Lexing failed: {}" , e ) ) ) ?;
191+ . map_err ( |e| NagariError :: LexError ( format ! ( "Lexing failed: {e}" ) ) ) ?;
192192
193193 // Parsing
194194 let mut parser = NagParser :: new ( tokens) ;
195195 let ast = parser
196196 . parse ( )
197- . map_err ( |e| NagariError :: ParseError ( format ! ( "Parsing failed: {}" , e ) ) ) ?;
197+ . map_err ( |e| NagariError :: ParseError ( format ! ( "Parsing failed: {e}" ) ) ) ?;
198198
199199 if self . config . verbose {
200200 println ! ( "✅ Syntax check passed" ) ;
@@ -215,7 +215,7 @@ impl Compiler {
215215 // Create output directory if needed
216216 if let Some ( parent) = output_path. parent ( ) {
217217 fs:: create_dir_all ( parent) . map_err ( |e| {
218- NagariError :: IoError ( format ! ( "Failed to create output directory: {}" , e ) )
218+ NagariError :: IoError ( format ! ( "Failed to create output directory: {e}" ) )
219219 } ) ?;
220220 }
221221
@@ -232,20 +232,20 @@ impl Compiler {
232232
233233 // Write JavaScript output
234234 fs:: write ( output_path, final_code)
235- . map_err ( |e| NagariError :: IoError ( format ! ( "Failed to write output file: {}" , e ) ) ) ?;
235+ . map_err ( |e| NagariError :: IoError ( format ! ( "Failed to write output file: {e}" ) ) ) ?;
236236
237237 // Write source map if enabled
238238 if let Some ( source_map) = result. source_map {
239239 let map_path = output_path. with_extension ( "js.map" ) ;
240240 fs:: write ( & map_path, source_map)
241- . map_err ( |e| NagariError :: IoError ( format ! ( "Failed to write source map: {}" , e ) ) ) ?;
241+ . map_err ( |e| NagariError :: IoError ( format ! ( "Failed to write source map: {e}" ) ) ) ?;
242242 }
243243
244244 // Write TypeScript declarations if enabled
245245 if let Some ( declarations) = result. declarations {
246246 let dts_path = output_path. with_extension ( "d.ts" ) ;
247247 fs:: write ( & dts_path, declarations) . map_err ( |e| {
248- NagariError :: IoError ( format ! ( "Failed to write declarations: {}" , e ) )
248+ NagariError :: IoError ( format ! ( "Failed to write declarations: {e}" ) )
249249 } ) ?;
250250 }
251251
0 commit comments