@@ -101,9 +101,7 @@ pub fn assert_metrics_results_contains(expected_content: &str) -> Result<()> {
101101 reader. read_to_string ( & mut contents) ?;
102102 assert ! (
103103 contents. contains( expected_content) ,
104- "Expected content {} not found in actual content {}" ,
105- expected_content,
106- contents
104+ "Expected content {expected_content} not found in actual content {contents}"
107105 ) ;
108106 Ok ( ( ) )
109107}
@@ -162,12 +160,7 @@ pub fn fetch_latest_metrics_for_scope(scope_name: &str) -> Result<Value> {
162160 None
163161 } )
164162 } )
165- . with_context ( || {
166- format ! (
167- "No valid JSON line containing scope `{}` found." ,
168- scope_name
169- )
170- } ) ?;
163+ . with_context ( || format ! ( "No valid JSON line containing scope `{scope_name}` found." ) ) ?;
171164
172165 Ok ( json_line)
173166}
@@ -178,18 +171,16 @@ pub fn fetch_latest_metrics_for_scope(scope_name: &str) -> Result<Value> {
178171///
179172pub fn validate_metrics_against_results ( scope_name : & str ) -> Result < ( ) > {
180173 // Define the results file path
181- let results_file_path = format ! ( "./expected/metrics/{}.json" , scope_name ) ;
174+ let results_file_path = format ! ( "./expected/metrics/{scope_name }.json" ) ;
182175
183176 // Fetch the actual metrics for the given scope
184177 let actual_metrics = fetch_latest_metrics_for_scope ( scope_name)
185- . context ( format ! ( "Failed to fetch metrics for scope: {}" , scope_name ) ) ?;
178+ . context ( format ! ( "Failed to fetch metrics for scope: {scope_name}" ) ) ?;
186179
187180 // Read the expected metrics from the results file
188181 let expected_metrics = {
189- let file = File :: open ( & results_file_path) . context ( format ! (
190- "Failed to open results file: {}" ,
191- results_file_path
192- ) ) ?;
182+ let file = File :: open ( & results_file_path)
183+ . context ( format ! ( "Failed to open results file: {results_file_path}" ) ) ?;
193184 read_metrics_from_json ( file)
194185 } ?;
195186
0 commit comments