@@ -189,18 +189,21 @@ pub fn write_report(
189189 ReportFormat :: Text => {
190190 let text = render_text_report ( report) ;
191191 let path = format ! ( "{base_path}.txt" ) ;
192- std:: fs:: write ( & path, text) . with_context ( || format ! ( "Failed to write report: {path}" ) ) ?;
192+ std:: fs:: write ( & path, text)
193+ . with_context ( || format ! ( "Failed to write report: {path}" ) ) ?;
193194 }
194195 ReportFormat :: Json => {
195196 let json = serde_json:: to_string_pretty ( report)
196197 . context ( "Failed to serialize report to JSON" ) ?;
197198 let path = format ! ( "{base_path}.json" ) ;
198- std:: fs:: write ( & path, json) . with_context ( || format ! ( "Failed to write report: {path}" ) ) ?;
199+ std:: fs:: write ( & path, json)
200+ . with_context ( || format ! ( "Failed to write report: {path}" ) ) ?;
199201 }
200202 ReportFormat :: Csrd => {
201203 let csrd = render_csrd_report ( report) ;
202204 let path = format ! ( "{base_path}.csrd.txt" ) ;
203- std:: fs:: write ( & path, csrd) . with_context ( || format ! ( "Failed to write report: {path}" ) ) ?;
205+ std:: fs:: write ( & path, csrd)
206+ . with_context ( || format ! ( "Failed to write report: {path}" ) ) ?;
204207 }
205208 }
206209 Ok ( ( ) )
@@ -268,9 +271,7 @@ fn render_csrd_report(report: &SustainabilityReport) -> String {
268271 out. push_str ( & format ! ( "Project: {}\n " , report. project_name) ) ;
269272 out. push_str ( & format ! ( "Grid Region: {}\n " , report. region) ) ;
270273 out. push_str ( & format ! ( "Carbon Data Provider: {}\n " , report. provider) ) ;
271- out. push_str ( & format ! (
272- "Reporting Period: Generated by eclexiaiser\n \n "
273- ) ) ;
274+ out. push_str ( "Reporting Period: Generated by eclexiaiser\n \n " ) ;
274275
275276 out. push_str ( "1. SCOPE 2 EMISSIONS — Computational Energy\n \n " ) ;
276277 out. push_str ( & format ! (
@@ -332,9 +333,7 @@ fn render_csrd_report(report: &SustainabilityReport) -> String {
332333#[ cfg( test) ]
333334mod tests {
334335 use super :: * ;
335- use crate :: abi:: {
336- CarbonConfig , CarbonProvider , FunctionBudget , ReportConfig , ReportFormat ,
337- } ;
336+ use crate :: abi:: { CarbonConfig , CarbonProvider , FunctionBudget , ReportConfig , ReportFormat } ;
338337 use crate :: manifest:: { Manifest , ProjectConfig } ;
339338
340339 fn test_manifest ( ) -> Manifest {
@@ -424,6 +423,11 @@ mod tests {
424423 let report = generate_simulated_report ( & m, 1.5 ) . unwrap ( ) ;
425424 assert ! ( !report. recommendations. is_empty( ) ) ;
426425 // Should have recommendation about fast_func exceeding budget.
427- assert ! ( report. recommendations. iter( ) . any( |r| r. contains( "fast_func" ) ) ) ;
426+ assert ! (
427+ report
428+ . recommendations
429+ . iter( )
430+ . any( |r| r. contains( "fast_func" ) )
431+ ) ;
428432 }
429433}
0 commit comments